1 // Code generated from gen/386.rules; DO NOT EDIT.
2 // generated with: cd gen; go run *.go
7 "cmd/compile/internal/types"
11 func rewriteValue386(v *Value) bool {
14 return rewriteValue386_Op386ADCL(v)
16 return rewriteValue386_Op386ADDL(v)
18 return rewriteValue386_Op386ADDLcarry(v)
20 return rewriteValue386_Op386ADDLconst(v)
21 case Op386ADDLconstmodify:
22 return rewriteValue386_Op386ADDLconstmodify(v)
24 return rewriteValue386_Op386ADDLload(v)
26 return rewriteValue386_Op386ADDLmodify(v)
28 return rewriteValue386_Op386ADDSD(v)
30 return rewriteValue386_Op386ADDSDload(v)
32 return rewriteValue386_Op386ADDSS(v)
34 return rewriteValue386_Op386ADDSSload(v)
36 return rewriteValue386_Op386ANDL(v)
38 return rewriteValue386_Op386ANDLconst(v)
39 case Op386ANDLconstmodify:
40 return rewriteValue386_Op386ANDLconstmodify(v)
42 return rewriteValue386_Op386ANDLload(v)
44 return rewriteValue386_Op386ANDLmodify(v)
46 return rewriteValue386_Op386CMPB(v)
48 return rewriteValue386_Op386CMPBconst(v)
50 return rewriteValue386_Op386CMPBload(v)
52 return rewriteValue386_Op386CMPL(v)
54 return rewriteValue386_Op386CMPLconst(v)
56 return rewriteValue386_Op386CMPLload(v)
58 return rewriteValue386_Op386CMPW(v)
60 return rewriteValue386_Op386CMPWconst(v)
62 return rewriteValue386_Op386CMPWload(v)
64 return rewriteValue386_Op386DIVSD(v)
66 return rewriteValue386_Op386DIVSDload(v)
68 return rewriteValue386_Op386DIVSS(v)
70 return rewriteValue386_Op386DIVSSload(v)
72 return rewriteValue386_Op386LEAL(v)
74 return rewriteValue386_Op386LEAL1(v)
76 return rewriteValue386_Op386LEAL2(v)
78 return rewriteValue386_Op386LEAL4(v)
80 return rewriteValue386_Op386LEAL8(v)
82 return rewriteValue386_Op386MOVBLSX(v)
83 case Op386MOVBLSXload:
84 return rewriteValue386_Op386MOVBLSXload(v)
86 return rewriteValue386_Op386MOVBLZX(v)
88 return rewriteValue386_Op386MOVBload(v)
90 return rewriteValue386_Op386MOVBstore(v)
91 case Op386MOVBstoreconst:
92 return rewriteValue386_Op386MOVBstoreconst(v)
94 return rewriteValue386_Op386MOVLload(v)
96 return rewriteValue386_Op386MOVLstore(v)
97 case Op386MOVLstoreconst:
98 return rewriteValue386_Op386MOVLstoreconst(v)
100 return rewriteValue386_Op386MOVSDconst(v)
102 return rewriteValue386_Op386MOVSDload(v)
103 case Op386MOVSDstore:
104 return rewriteValue386_Op386MOVSDstore(v)
105 case Op386MOVSSconst:
106 return rewriteValue386_Op386MOVSSconst(v)
108 return rewriteValue386_Op386MOVSSload(v)
109 case Op386MOVSSstore:
110 return rewriteValue386_Op386MOVSSstore(v)
112 return rewriteValue386_Op386MOVWLSX(v)
113 case Op386MOVWLSXload:
114 return rewriteValue386_Op386MOVWLSXload(v)
116 return rewriteValue386_Op386MOVWLZX(v)
118 return rewriteValue386_Op386MOVWload(v)
120 return rewriteValue386_Op386MOVWstore(v)
121 case Op386MOVWstoreconst:
122 return rewriteValue386_Op386MOVWstoreconst(v)
124 return rewriteValue386_Op386MULL(v)
126 return rewriteValue386_Op386MULLconst(v)
128 return rewriteValue386_Op386MULLload(v)
130 return rewriteValue386_Op386MULSD(v)
132 return rewriteValue386_Op386MULSDload(v)
134 return rewriteValue386_Op386MULSS(v)
136 return rewriteValue386_Op386MULSSload(v)
138 return rewriteValue386_Op386NEGL(v)
140 return rewriteValue386_Op386NOTL(v)
142 return rewriteValue386_Op386ORL(v)
144 return rewriteValue386_Op386ORLconst(v)
145 case Op386ORLconstmodify:
146 return rewriteValue386_Op386ORLconstmodify(v)
148 return rewriteValue386_Op386ORLload(v)
150 return rewriteValue386_Op386ORLmodify(v)
152 return rewriteValue386_Op386ROLBconst(v)
154 return rewriteValue386_Op386ROLLconst(v)
156 return rewriteValue386_Op386ROLWconst(v)
158 return rewriteValue386_Op386SARB(v)
160 return rewriteValue386_Op386SARBconst(v)
162 return rewriteValue386_Op386SARL(v)
164 return rewriteValue386_Op386SARLconst(v)
166 return rewriteValue386_Op386SARW(v)
168 return rewriteValue386_Op386SARWconst(v)
170 return rewriteValue386_Op386SBBL(v)
171 case Op386SBBLcarrymask:
172 return rewriteValue386_Op386SBBLcarrymask(v)
174 return rewriteValue386_Op386SETA(v)
176 return rewriteValue386_Op386SETAE(v)
178 return rewriteValue386_Op386SETB(v)
180 return rewriteValue386_Op386SETBE(v)
182 return rewriteValue386_Op386SETEQ(v)
184 return rewriteValue386_Op386SETG(v)
186 return rewriteValue386_Op386SETGE(v)
188 return rewriteValue386_Op386SETL(v)
190 return rewriteValue386_Op386SETLE(v)
192 return rewriteValue386_Op386SETNE(v)
194 return rewriteValue386_Op386SHLL(v)
196 return rewriteValue386_Op386SHLLconst(v)
198 return rewriteValue386_Op386SHRB(v)
200 return rewriteValue386_Op386SHRBconst(v)
202 return rewriteValue386_Op386SHRL(v)
204 return rewriteValue386_Op386SHRLconst(v)
206 return rewriteValue386_Op386SHRW(v)
208 return rewriteValue386_Op386SHRWconst(v)
210 return rewriteValue386_Op386SUBL(v)
212 return rewriteValue386_Op386SUBLcarry(v)
214 return rewriteValue386_Op386SUBLconst(v)
216 return rewriteValue386_Op386SUBLload(v)
217 case Op386SUBLmodify:
218 return rewriteValue386_Op386SUBLmodify(v)
220 return rewriteValue386_Op386SUBSD(v)
222 return rewriteValue386_Op386SUBSDload(v)
224 return rewriteValue386_Op386SUBSS(v)
226 return rewriteValue386_Op386SUBSSload(v)
228 return rewriteValue386_Op386XORL(v)
230 return rewriteValue386_Op386XORLconst(v)
231 case Op386XORLconstmodify:
232 return rewriteValue386_Op386XORLconstmodify(v)
234 return rewriteValue386_Op386XORLload(v)
235 case Op386XORLmodify:
236 return rewriteValue386_Op386XORLmodify(v)
247 v.Op = Op386ADDLcarry
249 case OpAdd32withcarry:
262 return rewriteValue386_OpAddr(v)
282 v.Op = Op386CALLclosure
294 return rewriteValue386_OpConst16(v)
296 v.Op = Op386MOVLconst
299 v.Op = Op386MOVSSconst
302 v.Op = Op386MOVSDconst
305 return rewriteValue386_OpConst8(v)
307 return rewriteValue386_OpConstBool(v)
309 return rewriteValue386_OpConstNil(v)
311 return rewriteValue386_OpCtz16(v)
316 v.Op = Op386CVTTSS2SL
328 v.Op = Op386CVTTSD2SL
333 case OpCvtBoolToUint8:
355 return rewriteValue386_OpDiv8(v)
357 return rewriteValue386_OpDiv8u(v)
359 return rewriteValue386_OpEq16(v)
361 return rewriteValue386_OpEq32(v)
363 return rewriteValue386_OpEq32F(v)
365 return rewriteValue386_OpEq64F(v)
367 return rewriteValue386_OpEq8(v)
369 return rewriteValue386_OpEqB(v)
371 return rewriteValue386_OpEqPtr(v)
373 v.Op = Op386LoweredGetCallerPC
376 v.Op = Op386LoweredGetCallerSP
378 case OpGetClosurePtr:
379 v.Op = Op386LoweredGetClosurePtr
382 v.Op = Op386LoweredGetG
391 v.Op = Op386CALLinter
394 return rewriteValue386_OpIsInBounds(v)
396 return rewriteValue386_OpIsNonNil(v)
397 case OpIsSliceInBounds:
398 return rewriteValue386_OpIsSliceInBounds(v)
400 return rewriteValue386_OpLeq16(v)
402 return rewriteValue386_OpLeq16U(v)
404 return rewriteValue386_OpLeq32(v)
406 return rewriteValue386_OpLeq32F(v)
408 return rewriteValue386_OpLeq32U(v)
410 return rewriteValue386_OpLeq64F(v)
412 return rewriteValue386_OpLeq8(v)
414 return rewriteValue386_OpLeq8U(v)
416 return rewriteValue386_OpLess16(v)
418 return rewriteValue386_OpLess16U(v)
420 return rewriteValue386_OpLess32(v)
422 return rewriteValue386_OpLess32F(v)
424 return rewriteValue386_OpLess32U(v)
426 return rewriteValue386_OpLess64F(v)
428 return rewriteValue386_OpLess8(v)
430 return rewriteValue386_OpLess8U(v)
432 return rewriteValue386_OpLoad(v)
434 return rewriteValue386_OpLocalAddr(v)
436 return rewriteValue386_OpLsh16x16(v)
438 return rewriteValue386_OpLsh16x32(v)
440 return rewriteValue386_OpLsh16x64(v)
442 return rewriteValue386_OpLsh16x8(v)
444 return rewriteValue386_OpLsh32x16(v)
446 return rewriteValue386_OpLsh32x32(v)
448 return rewriteValue386_OpLsh32x64(v)
450 return rewriteValue386_OpLsh32x8(v)
452 return rewriteValue386_OpLsh8x16(v)
454 return rewriteValue386_OpLsh8x32(v)
456 return rewriteValue386_OpLsh8x64(v)
458 return rewriteValue386_OpLsh8x8(v)
472 return rewriteValue386_OpMod8(v)
474 return rewriteValue386_OpMod8u(v)
476 return rewriteValue386_OpMove(v)
502 return rewriteValue386_OpNeg32F(v)
504 return rewriteValue386_OpNeg64F(v)
509 return rewriteValue386_OpNeq16(v)
511 return rewriteValue386_OpNeq32(v)
513 return rewriteValue386_OpNeq32F(v)
515 return rewriteValue386_OpNeq64F(v)
517 return rewriteValue386_OpNeq8(v)
519 return rewriteValue386_OpNeqB(v)
521 return rewriteValue386_OpNeqPtr(v)
523 v.Op = Op386LoweredNilCheck
526 return rewriteValue386_OpNot(v)
528 return rewriteValue386_OpOffPtr(v)
542 return rewriteValue386_OpPanicBounds(v)
544 return rewriteValue386_OpPanicExtend(v)
546 return rewriteValue386_OpRotateLeft16(v)
548 return rewriteValue386_OpRotateLeft32(v)
550 return rewriteValue386_OpRotateLeft8(v)
558 return rewriteValue386_OpRsh16Ux16(v)
560 return rewriteValue386_OpRsh16Ux32(v)
562 return rewriteValue386_OpRsh16Ux64(v)
564 return rewriteValue386_OpRsh16Ux8(v)
566 return rewriteValue386_OpRsh16x16(v)
568 return rewriteValue386_OpRsh16x32(v)
570 return rewriteValue386_OpRsh16x64(v)
572 return rewriteValue386_OpRsh16x8(v)
574 return rewriteValue386_OpRsh32Ux16(v)
576 return rewriteValue386_OpRsh32Ux32(v)
578 return rewriteValue386_OpRsh32Ux64(v)
580 return rewriteValue386_OpRsh32Ux8(v)
582 return rewriteValue386_OpRsh32x16(v)
584 return rewriteValue386_OpRsh32x32(v)
586 return rewriteValue386_OpRsh32x64(v)
588 return rewriteValue386_OpRsh32x8(v)
590 return rewriteValue386_OpRsh8Ux16(v)
592 return rewriteValue386_OpRsh8Ux32(v)
594 return rewriteValue386_OpRsh8Ux64(v)
596 return rewriteValue386_OpRsh8Ux8(v)
598 return rewriteValue386_OpRsh8x16(v)
600 return rewriteValue386_OpRsh8x32(v)
602 return rewriteValue386_OpRsh8x64(v)
604 return rewriteValue386_OpRsh8x8(v)
606 return rewriteValue386_OpSelect0(v)
608 return rewriteValue386_OpSelect1(v)
609 case OpSignExt16to32:
619 return rewriteValue386_OpSignmask(v)
621 return rewriteValue386_OpSlicemask(v)
629 v.Op = Op386CALLstatic
632 return rewriteValue386_OpStore(v)
643 v.Op = Op386SUBLcarry
645 case OpSub32withcarry:
667 v.Op = Op386LoweredWB
679 return rewriteValue386_OpZero(v)
680 case OpZeroExt16to32:
690 return rewriteValue386_OpZeromask(v)
694 func rewriteValue386_Op386ADCL(v *Value) bool {
698 // match: (ADCL x (MOVLconst [c]) f)
699 // result: (ADCLconst [c] x f)
701 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
703 if v_1.Op != Op386MOVLconst {
706 c := auxIntToInt32(v_1.AuxInt)
708 v.reset(Op386ADCLconst)
709 v.AuxInt = int32ToAuxInt(c)
717 func rewriteValue386_Op386ADDL(v *Value) bool {
720 // match: (ADDL x (MOVLconst [c]))
721 // result: (ADDLconst [c] x)
723 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
725 if v_1.Op != Op386MOVLconst {
728 c := auxIntToInt32(v_1.AuxInt)
729 v.reset(Op386ADDLconst)
730 v.AuxInt = int32ToAuxInt(c)
736 // match: (ADDL (SHLLconst [c] x) (SHRLconst [d] x))
738 // result: (ROLLconst [c] x)
740 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
741 if v_0.Op != Op386SHLLconst {
744 c := auxIntToInt32(v_0.AuxInt)
746 if v_1.Op != Op386SHRLconst {
749 d := auxIntToInt32(v_1.AuxInt)
750 if x != v_1.Args[0] || !(d == 32-c) {
753 v.reset(Op386ROLLconst)
754 v.AuxInt = int32ToAuxInt(c)
760 // match: (ADDL <t> (SHLLconst x [c]) (SHRWconst x [d]))
761 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
762 // result: (ROLWconst x [int16(c)])
765 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
766 if v_0.Op != Op386SHLLconst {
769 c := auxIntToInt32(v_0.AuxInt)
771 if v_1.Op != Op386SHRWconst {
774 d := auxIntToInt16(v_1.AuxInt)
775 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
778 v.reset(Op386ROLWconst)
779 v.AuxInt = int16ToAuxInt(int16(c))
785 // match: (ADDL <t> (SHLLconst x [c]) (SHRBconst x [d]))
786 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
787 // result: (ROLBconst x [int8(c)])
790 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
791 if v_0.Op != Op386SHLLconst {
794 c := auxIntToInt32(v_0.AuxInt)
796 if v_1.Op != Op386SHRBconst {
799 d := auxIntToInt8(v_1.AuxInt)
800 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
803 v.reset(Op386ROLBconst)
804 v.AuxInt = int8ToAuxInt(int8(c))
810 // match: (ADDL x (SHLLconst [3] y))
811 // result: (LEAL8 x y)
813 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
815 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
825 // match: (ADDL x (SHLLconst [2] y))
826 // result: (LEAL4 x y)
828 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
830 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
840 // match: (ADDL x (SHLLconst [1] y))
841 // result: (LEAL2 x y)
843 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
845 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
855 // match: (ADDL x (ADDL y y))
856 // result: (LEAL2 x y)
858 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
860 if v_1.Op != Op386ADDL {
864 if y != v_1.Args[0] {
873 // match: (ADDL x (ADDL x y))
874 // result: (LEAL2 y x)
876 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
878 if v_1.Op != Op386ADDL {
884 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
896 // match: (ADDL (ADDLconst [c] x) y)
897 // result: (LEAL1 [c] x y)
899 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
900 if v_0.Op != Op386ADDLconst {
903 c := auxIntToInt32(v_0.AuxInt)
907 v.AuxInt = int32ToAuxInt(c)
913 // match: (ADDL x (LEAL [c] {s} y))
914 // cond: x.Op != OpSB && y.Op != OpSB
915 // result: (LEAL1 [c] {s} x y)
917 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
919 if v_1.Op != Op386LEAL {
922 c := auxIntToInt32(v_1.AuxInt)
923 s := auxToSym(v_1.Aux)
925 if !(x.Op != OpSB && y.Op != OpSB) {
929 v.AuxInt = int32ToAuxInt(c)
936 // match: (ADDL x l:(MOVLload [off] {sym} ptr mem))
937 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
938 // result: (ADDLload x [off] {sym} ptr mem)
940 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
943 if l.Op != Op386MOVLload {
946 off := auxIntToInt32(l.AuxInt)
947 sym := auxToSym(l.Aux)
950 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
953 v.reset(Op386ADDLload)
954 v.AuxInt = int32ToAuxInt(off)
955 v.Aux = symToAux(sym)
956 v.AddArg3(x, ptr, mem)
961 // match: (ADDL x (NEGL y))
962 // result: (SUBL x y)
964 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
966 if v_1.Op != Op386NEGL {
978 func rewriteValue386_Op386ADDLcarry(v *Value) bool {
981 // match: (ADDLcarry x (MOVLconst [c]))
982 // result: (ADDLconstcarry [c] x)
984 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
986 if v_1.Op != Op386MOVLconst {
989 c := auxIntToInt32(v_1.AuxInt)
990 v.reset(Op386ADDLconstcarry)
991 v.AuxInt = int32ToAuxInt(c)
999 func rewriteValue386_Op386ADDLconst(v *Value) bool {
1001 // match: (ADDLconst [c] (ADDL x y))
1002 // result: (LEAL1 [c] x y)
1004 c := auxIntToInt32(v.AuxInt)
1005 if v_0.Op != Op386ADDL {
1011 v.AuxInt = int32ToAuxInt(c)
1015 // match: (ADDLconst [c] (LEAL [d] {s} x))
1016 // cond: is32Bit(int64(c)+int64(d))
1017 // result: (LEAL [c+d] {s} x)
1019 c := auxIntToInt32(v.AuxInt)
1020 if v_0.Op != Op386LEAL {
1023 d := auxIntToInt32(v_0.AuxInt)
1024 s := auxToSym(v_0.Aux)
1026 if !(is32Bit(int64(c) + int64(d))) {
1030 v.AuxInt = int32ToAuxInt(c + d)
1035 // match: (ADDLconst [c] x:(SP))
1036 // result: (LEAL [c] x)
1038 c := auxIntToInt32(v.AuxInt)
1044 v.AuxInt = int32ToAuxInt(c)
1048 // match: (ADDLconst [c] (LEAL1 [d] {s} x y))
1049 // cond: is32Bit(int64(c)+int64(d))
1050 // result: (LEAL1 [c+d] {s} x y)
1052 c := auxIntToInt32(v.AuxInt)
1053 if v_0.Op != Op386LEAL1 {
1056 d := auxIntToInt32(v_0.AuxInt)
1057 s := auxToSym(v_0.Aux)
1060 if !(is32Bit(int64(c) + int64(d))) {
1064 v.AuxInt = int32ToAuxInt(c + d)
1069 // match: (ADDLconst [c] (LEAL2 [d] {s} x y))
1070 // cond: is32Bit(int64(c)+int64(d))
1071 // result: (LEAL2 [c+d] {s} x y)
1073 c := auxIntToInt32(v.AuxInt)
1074 if v_0.Op != Op386LEAL2 {
1077 d := auxIntToInt32(v_0.AuxInt)
1078 s := auxToSym(v_0.Aux)
1081 if !(is32Bit(int64(c) + int64(d))) {
1085 v.AuxInt = int32ToAuxInt(c + d)
1090 // match: (ADDLconst [c] (LEAL4 [d] {s} x y))
1091 // cond: is32Bit(int64(c)+int64(d))
1092 // result: (LEAL4 [c+d] {s} x y)
1094 c := auxIntToInt32(v.AuxInt)
1095 if v_0.Op != Op386LEAL4 {
1098 d := auxIntToInt32(v_0.AuxInt)
1099 s := auxToSym(v_0.Aux)
1102 if !(is32Bit(int64(c) + int64(d))) {
1106 v.AuxInt = int32ToAuxInt(c + d)
1111 // match: (ADDLconst [c] (LEAL8 [d] {s} x y))
1112 // cond: is32Bit(int64(c)+int64(d))
1113 // result: (LEAL8 [c+d] {s} x y)
1115 c := auxIntToInt32(v.AuxInt)
1116 if v_0.Op != Op386LEAL8 {
1119 d := auxIntToInt32(v_0.AuxInt)
1120 s := auxToSym(v_0.Aux)
1123 if !(is32Bit(int64(c) + int64(d))) {
1127 v.AuxInt = int32ToAuxInt(c + d)
1132 // match: (ADDLconst [c] x)
1136 c := auxIntToInt32(v.AuxInt)
1144 // match: (ADDLconst [c] (MOVLconst [d]))
1145 // result: (MOVLconst [c+d])
1147 c := auxIntToInt32(v.AuxInt)
1148 if v_0.Op != Op386MOVLconst {
1151 d := auxIntToInt32(v_0.AuxInt)
1152 v.reset(Op386MOVLconst)
1153 v.AuxInt = int32ToAuxInt(c + d)
1156 // match: (ADDLconst [c] (ADDLconst [d] x))
1157 // result: (ADDLconst [c+d] x)
1159 c := auxIntToInt32(v.AuxInt)
1160 if v_0.Op != Op386ADDLconst {
1163 d := auxIntToInt32(v_0.AuxInt)
1165 v.reset(Op386ADDLconst)
1166 v.AuxInt = int32ToAuxInt(c + d)
1172 func rewriteValue386_Op386ADDLconstmodify(v *Value) bool {
1176 config := b.Func.Config
1177 // match: (ADDLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
1178 // cond: valoff1.canAdd32(off2)
1179 // result: (ADDLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
1181 valoff1 := auxIntToValAndOff(v.AuxInt)
1182 sym := auxToSym(v.Aux)
1183 if v_0.Op != Op386ADDLconst {
1186 off2 := auxIntToInt32(v_0.AuxInt)
1189 if !(valoff1.canAdd32(off2)) {
1192 v.reset(Op386ADDLconstmodify)
1193 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1194 v.Aux = symToAux(sym)
1195 v.AddArg2(base, mem)
1198 // match: (ADDLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
1199 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1200 // result: (ADDLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
1202 valoff1 := auxIntToValAndOff(v.AuxInt)
1203 sym1 := auxToSym(v.Aux)
1204 if v_0.Op != Op386LEAL {
1207 off2 := auxIntToInt32(v_0.AuxInt)
1208 sym2 := auxToSym(v_0.Aux)
1211 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1214 v.reset(Op386ADDLconstmodify)
1215 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1216 v.Aux = symToAux(mergeSym(sym1, sym2))
1217 v.AddArg2(base, mem)
1222 func rewriteValue386_Op386ADDLload(v *Value) bool {
1227 config := b.Func.Config
1228 // match: (ADDLload [off1] {sym} val (ADDLconst [off2] base) mem)
1229 // cond: is32Bit(int64(off1)+int64(off2))
1230 // result: (ADDLload [off1+off2] {sym} val base mem)
1232 off1 := auxIntToInt32(v.AuxInt)
1233 sym := auxToSym(v.Aux)
1235 if v_1.Op != Op386ADDLconst {
1238 off2 := auxIntToInt32(v_1.AuxInt)
1241 if !(is32Bit(int64(off1) + int64(off2))) {
1244 v.reset(Op386ADDLload)
1245 v.AuxInt = int32ToAuxInt(off1 + off2)
1246 v.Aux = symToAux(sym)
1247 v.AddArg3(val, base, mem)
1250 // match: (ADDLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1251 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1252 // result: (ADDLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1254 off1 := auxIntToInt32(v.AuxInt)
1255 sym1 := auxToSym(v.Aux)
1257 if v_1.Op != Op386LEAL {
1260 off2 := auxIntToInt32(v_1.AuxInt)
1261 sym2 := auxToSym(v_1.Aux)
1264 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1267 v.reset(Op386ADDLload)
1268 v.AuxInt = int32ToAuxInt(off1 + off2)
1269 v.Aux = symToAux(mergeSym(sym1, sym2))
1270 v.AddArg3(val, base, mem)
1275 func rewriteValue386_Op386ADDLmodify(v *Value) bool {
1280 config := b.Func.Config
1281 // match: (ADDLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
1282 // cond: is32Bit(int64(off1)+int64(off2))
1283 // result: (ADDLmodify [off1+off2] {sym} base val mem)
1285 off1 := auxIntToInt32(v.AuxInt)
1286 sym := auxToSym(v.Aux)
1287 if v_0.Op != Op386ADDLconst {
1290 off2 := auxIntToInt32(v_0.AuxInt)
1294 if !(is32Bit(int64(off1) + int64(off2))) {
1297 v.reset(Op386ADDLmodify)
1298 v.AuxInt = int32ToAuxInt(off1 + off2)
1299 v.Aux = symToAux(sym)
1300 v.AddArg3(base, val, mem)
1303 // match: (ADDLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
1304 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1305 // result: (ADDLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
1307 off1 := auxIntToInt32(v.AuxInt)
1308 sym1 := auxToSym(v.Aux)
1309 if v_0.Op != Op386LEAL {
1312 off2 := auxIntToInt32(v_0.AuxInt)
1313 sym2 := auxToSym(v_0.Aux)
1317 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1320 v.reset(Op386ADDLmodify)
1321 v.AuxInt = int32ToAuxInt(off1 + off2)
1322 v.Aux = symToAux(mergeSym(sym1, sym2))
1323 v.AddArg3(base, val, mem)
1328 func rewriteValue386_Op386ADDSD(v *Value) bool {
1331 // match: (ADDSD x l:(MOVSDload [off] {sym} ptr mem))
1332 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1333 // result: (ADDSDload x [off] {sym} ptr mem)
1335 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1338 if l.Op != Op386MOVSDload {
1341 off := auxIntToInt32(l.AuxInt)
1342 sym := auxToSym(l.Aux)
1345 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1348 v.reset(Op386ADDSDload)
1349 v.AuxInt = int32ToAuxInt(off)
1350 v.Aux = symToAux(sym)
1351 v.AddArg3(x, ptr, mem)
1358 func rewriteValue386_Op386ADDSDload(v *Value) bool {
1363 config := b.Func.Config
1364 // match: (ADDSDload [off1] {sym} val (ADDLconst [off2] base) mem)
1365 // cond: is32Bit(int64(off1)+int64(off2))
1366 // result: (ADDSDload [off1+off2] {sym} val base mem)
1368 off1 := auxIntToInt32(v.AuxInt)
1369 sym := auxToSym(v.Aux)
1371 if v_1.Op != Op386ADDLconst {
1374 off2 := auxIntToInt32(v_1.AuxInt)
1377 if !(is32Bit(int64(off1) + int64(off2))) {
1380 v.reset(Op386ADDSDload)
1381 v.AuxInt = int32ToAuxInt(off1 + off2)
1382 v.Aux = symToAux(sym)
1383 v.AddArg3(val, base, mem)
1386 // match: (ADDSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1387 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1388 // result: (ADDSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1390 off1 := auxIntToInt32(v.AuxInt)
1391 sym1 := auxToSym(v.Aux)
1393 if v_1.Op != Op386LEAL {
1396 off2 := auxIntToInt32(v_1.AuxInt)
1397 sym2 := auxToSym(v_1.Aux)
1400 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1403 v.reset(Op386ADDSDload)
1404 v.AuxInt = int32ToAuxInt(off1 + off2)
1405 v.Aux = symToAux(mergeSym(sym1, sym2))
1406 v.AddArg3(val, base, mem)
1411 func rewriteValue386_Op386ADDSS(v *Value) bool {
1414 // match: (ADDSS x l:(MOVSSload [off] {sym} ptr mem))
1415 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1416 // result: (ADDSSload x [off] {sym} ptr mem)
1418 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1421 if l.Op != Op386MOVSSload {
1424 off := auxIntToInt32(l.AuxInt)
1425 sym := auxToSym(l.Aux)
1428 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1431 v.reset(Op386ADDSSload)
1432 v.AuxInt = int32ToAuxInt(off)
1433 v.Aux = symToAux(sym)
1434 v.AddArg3(x, ptr, mem)
1441 func rewriteValue386_Op386ADDSSload(v *Value) bool {
1446 config := b.Func.Config
1447 // match: (ADDSSload [off1] {sym} val (ADDLconst [off2] base) mem)
1448 // cond: is32Bit(int64(off1)+int64(off2))
1449 // result: (ADDSSload [off1+off2] {sym} val base mem)
1451 off1 := auxIntToInt32(v.AuxInt)
1452 sym := auxToSym(v.Aux)
1454 if v_1.Op != Op386ADDLconst {
1457 off2 := auxIntToInt32(v_1.AuxInt)
1460 if !(is32Bit(int64(off1) + int64(off2))) {
1463 v.reset(Op386ADDSSload)
1464 v.AuxInt = int32ToAuxInt(off1 + off2)
1465 v.Aux = symToAux(sym)
1466 v.AddArg3(val, base, mem)
1469 // match: (ADDSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1470 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1471 // result: (ADDSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1473 off1 := auxIntToInt32(v.AuxInt)
1474 sym1 := auxToSym(v.Aux)
1476 if v_1.Op != Op386LEAL {
1479 off2 := auxIntToInt32(v_1.AuxInt)
1480 sym2 := auxToSym(v_1.Aux)
1483 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1486 v.reset(Op386ADDSSload)
1487 v.AuxInt = int32ToAuxInt(off1 + off2)
1488 v.Aux = symToAux(mergeSym(sym1, sym2))
1489 v.AddArg3(val, base, mem)
1494 func rewriteValue386_Op386ANDL(v *Value) bool {
1497 // match: (ANDL x (MOVLconst [c]))
1498 // result: (ANDLconst [c] x)
1500 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1502 if v_1.Op != Op386MOVLconst {
1505 c := auxIntToInt32(v_1.AuxInt)
1506 v.reset(Op386ANDLconst)
1507 v.AuxInt = int32ToAuxInt(c)
1513 // match: (ANDL x l:(MOVLload [off] {sym} ptr mem))
1514 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1515 // result: (ANDLload x [off] {sym} ptr mem)
1517 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1520 if l.Op != Op386MOVLload {
1523 off := auxIntToInt32(l.AuxInt)
1524 sym := auxToSym(l.Aux)
1527 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1530 v.reset(Op386ANDLload)
1531 v.AuxInt = int32ToAuxInt(off)
1532 v.Aux = symToAux(sym)
1533 v.AddArg3(x, ptr, mem)
1538 // match: (ANDL x x)
1550 func rewriteValue386_Op386ANDLconst(v *Value) bool {
1552 // match: (ANDLconst [c] (ANDLconst [d] x))
1553 // result: (ANDLconst [c & d] x)
1555 c := auxIntToInt32(v.AuxInt)
1556 if v_0.Op != Op386ANDLconst {
1559 d := auxIntToInt32(v_0.AuxInt)
1561 v.reset(Op386ANDLconst)
1562 v.AuxInt = int32ToAuxInt(c & d)
1566 // match: (ANDLconst [c] _)
1568 // result: (MOVLconst [0])
1570 c := auxIntToInt32(v.AuxInt)
1574 v.reset(Op386MOVLconst)
1575 v.AuxInt = int32ToAuxInt(0)
1578 // match: (ANDLconst [c] x)
1582 c := auxIntToInt32(v.AuxInt)
1590 // match: (ANDLconst [c] (MOVLconst [d]))
1591 // result: (MOVLconst [c&d])
1593 c := auxIntToInt32(v.AuxInt)
1594 if v_0.Op != Op386MOVLconst {
1597 d := auxIntToInt32(v_0.AuxInt)
1598 v.reset(Op386MOVLconst)
1599 v.AuxInt = int32ToAuxInt(c & d)
1604 func rewriteValue386_Op386ANDLconstmodify(v *Value) bool {
1608 config := b.Func.Config
1609 // match: (ANDLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
1610 // cond: valoff1.canAdd32(off2)
1611 // result: (ANDLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
1613 valoff1 := auxIntToValAndOff(v.AuxInt)
1614 sym := auxToSym(v.Aux)
1615 if v_0.Op != Op386ADDLconst {
1618 off2 := auxIntToInt32(v_0.AuxInt)
1621 if !(valoff1.canAdd32(off2)) {
1624 v.reset(Op386ANDLconstmodify)
1625 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1626 v.Aux = symToAux(sym)
1627 v.AddArg2(base, mem)
1630 // match: (ANDLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
1631 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1632 // result: (ANDLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
1634 valoff1 := auxIntToValAndOff(v.AuxInt)
1635 sym1 := auxToSym(v.Aux)
1636 if v_0.Op != Op386LEAL {
1639 off2 := auxIntToInt32(v_0.AuxInt)
1640 sym2 := auxToSym(v_0.Aux)
1643 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1646 v.reset(Op386ANDLconstmodify)
1647 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1648 v.Aux = symToAux(mergeSym(sym1, sym2))
1649 v.AddArg2(base, mem)
1654 func rewriteValue386_Op386ANDLload(v *Value) bool {
1659 config := b.Func.Config
1660 // match: (ANDLload [off1] {sym} val (ADDLconst [off2] base) mem)
1661 // cond: is32Bit(int64(off1)+int64(off2))
1662 // result: (ANDLload [off1+off2] {sym} val base mem)
1664 off1 := auxIntToInt32(v.AuxInt)
1665 sym := auxToSym(v.Aux)
1667 if v_1.Op != Op386ADDLconst {
1670 off2 := auxIntToInt32(v_1.AuxInt)
1673 if !(is32Bit(int64(off1) + int64(off2))) {
1676 v.reset(Op386ANDLload)
1677 v.AuxInt = int32ToAuxInt(off1 + off2)
1678 v.Aux = symToAux(sym)
1679 v.AddArg3(val, base, mem)
1682 // match: (ANDLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1683 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1684 // result: (ANDLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1686 off1 := auxIntToInt32(v.AuxInt)
1687 sym1 := auxToSym(v.Aux)
1689 if v_1.Op != Op386LEAL {
1692 off2 := auxIntToInt32(v_1.AuxInt)
1693 sym2 := auxToSym(v_1.Aux)
1696 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1699 v.reset(Op386ANDLload)
1700 v.AuxInt = int32ToAuxInt(off1 + off2)
1701 v.Aux = symToAux(mergeSym(sym1, sym2))
1702 v.AddArg3(val, base, mem)
1707 func rewriteValue386_Op386ANDLmodify(v *Value) bool {
1712 config := b.Func.Config
1713 // match: (ANDLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
1714 // cond: is32Bit(int64(off1)+int64(off2))
1715 // result: (ANDLmodify [off1+off2] {sym} base val mem)
1717 off1 := auxIntToInt32(v.AuxInt)
1718 sym := auxToSym(v.Aux)
1719 if v_0.Op != Op386ADDLconst {
1722 off2 := auxIntToInt32(v_0.AuxInt)
1726 if !(is32Bit(int64(off1) + int64(off2))) {
1729 v.reset(Op386ANDLmodify)
1730 v.AuxInt = int32ToAuxInt(off1 + off2)
1731 v.Aux = symToAux(sym)
1732 v.AddArg3(base, val, mem)
1735 // match: (ANDLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
1736 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1737 // result: (ANDLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
1739 off1 := auxIntToInt32(v.AuxInt)
1740 sym1 := auxToSym(v.Aux)
1741 if v_0.Op != Op386LEAL {
1744 off2 := auxIntToInt32(v_0.AuxInt)
1745 sym2 := auxToSym(v_0.Aux)
1749 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1752 v.reset(Op386ANDLmodify)
1753 v.AuxInt = int32ToAuxInt(off1 + off2)
1754 v.Aux = symToAux(mergeSym(sym1, sym2))
1755 v.AddArg3(base, val, mem)
1760 func rewriteValue386_Op386CMPB(v *Value) bool {
1764 // match: (CMPB x (MOVLconst [c]))
1765 // result: (CMPBconst x [int8(c)])
1768 if v_1.Op != Op386MOVLconst {
1771 c := auxIntToInt32(v_1.AuxInt)
1772 v.reset(Op386CMPBconst)
1773 v.AuxInt = int8ToAuxInt(int8(c))
1777 // match: (CMPB (MOVLconst [c]) x)
1778 // result: (InvertFlags (CMPBconst x [int8(c)]))
1780 if v_0.Op != Op386MOVLconst {
1783 c := auxIntToInt32(v_0.AuxInt)
1785 v.reset(Op386InvertFlags)
1786 v0 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
1787 v0.AuxInt = int8ToAuxInt(int8(c))
1792 // match: (CMPB x y)
1793 // cond: canonLessThan(x,y)
1794 // result: (InvertFlags (CMPB y x))
1798 if !(canonLessThan(x, y)) {
1801 v.reset(Op386InvertFlags)
1802 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
1807 // match: (CMPB l:(MOVBload {sym} [off] ptr mem) x)
1808 // cond: canMergeLoad(v, l) && clobber(l)
1809 // result: (CMPBload {sym} [off] ptr x mem)
1812 if l.Op != Op386MOVBload {
1815 off := auxIntToInt32(l.AuxInt)
1816 sym := auxToSym(l.Aux)
1820 if !(canMergeLoad(v, l) && clobber(l)) {
1823 v.reset(Op386CMPBload)
1824 v.AuxInt = int32ToAuxInt(off)
1825 v.Aux = symToAux(sym)
1826 v.AddArg3(ptr, x, mem)
1829 // match: (CMPB x l:(MOVBload {sym} [off] ptr mem))
1830 // cond: canMergeLoad(v, l) && clobber(l)
1831 // result: (InvertFlags (CMPBload {sym} [off] ptr x mem))
1835 if l.Op != Op386MOVBload {
1838 off := auxIntToInt32(l.AuxInt)
1839 sym := auxToSym(l.Aux)
1842 if !(canMergeLoad(v, l) && clobber(l)) {
1845 v.reset(Op386InvertFlags)
1846 v0 := b.NewValue0(l.Pos, Op386CMPBload, types.TypeFlags)
1847 v0.AuxInt = int32ToAuxInt(off)
1848 v0.Aux = symToAux(sym)
1849 v0.AddArg3(ptr, x, mem)
1855 func rewriteValue386_Op386CMPBconst(v *Value) bool {
1858 // match: (CMPBconst (MOVLconst [x]) [y])
1862 y := auxIntToInt8(v.AuxInt)
1863 if v_0.Op != Op386MOVLconst {
1866 x := auxIntToInt32(v_0.AuxInt)
1867 if !(int8(x) == y) {
1870 v.reset(Op386FlagEQ)
1873 // match: (CMPBconst (MOVLconst [x]) [y])
1874 // cond: int8(x)<y && uint8(x)<uint8(y)
1875 // result: (FlagLT_ULT)
1877 y := auxIntToInt8(v.AuxInt)
1878 if v_0.Op != Op386MOVLconst {
1881 x := auxIntToInt32(v_0.AuxInt)
1882 if !(int8(x) < y && uint8(x) < uint8(y)) {
1885 v.reset(Op386FlagLT_ULT)
1888 // match: (CMPBconst (MOVLconst [x]) [y])
1889 // cond: int8(x)<y && uint8(x)>uint8(y)
1890 // result: (FlagLT_UGT)
1892 y := auxIntToInt8(v.AuxInt)
1893 if v_0.Op != Op386MOVLconst {
1896 x := auxIntToInt32(v_0.AuxInt)
1897 if !(int8(x) < y && uint8(x) > uint8(y)) {
1900 v.reset(Op386FlagLT_UGT)
1903 // match: (CMPBconst (MOVLconst [x]) [y])
1904 // cond: int8(x)>y && uint8(x)<uint8(y)
1905 // result: (FlagGT_ULT)
1907 y := auxIntToInt8(v.AuxInt)
1908 if v_0.Op != Op386MOVLconst {
1911 x := auxIntToInt32(v_0.AuxInt)
1912 if !(int8(x) > y && uint8(x) < uint8(y)) {
1915 v.reset(Op386FlagGT_ULT)
1918 // match: (CMPBconst (MOVLconst [x]) [y])
1919 // cond: int8(x)>y && uint8(x)>uint8(y)
1920 // result: (FlagGT_UGT)
1922 y := auxIntToInt8(v.AuxInt)
1923 if v_0.Op != Op386MOVLconst {
1926 x := auxIntToInt32(v_0.AuxInt)
1927 if !(int8(x) > y && uint8(x) > uint8(y)) {
1930 v.reset(Op386FlagGT_UGT)
1933 // match: (CMPBconst (ANDLconst _ [m]) [n])
1934 // cond: 0 <= int8(m) && int8(m) < n
1935 // result: (FlagLT_ULT)
1937 n := auxIntToInt8(v.AuxInt)
1938 if v_0.Op != Op386ANDLconst {
1941 m := auxIntToInt32(v_0.AuxInt)
1942 if !(0 <= int8(m) && int8(m) < n) {
1945 v.reset(Op386FlagLT_ULT)
1948 // match: (CMPBconst l:(ANDL x y) [0])
1950 // result: (TESTB x y)
1952 if auxIntToInt8(v.AuxInt) != 0 {
1956 if l.Op != Op386ANDL {
1968 // match: (CMPBconst l:(ANDLconst [c] x) [0])
1970 // result: (TESTBconst [int8(c)] x)
1972 if auxIntToInt8(v.AuxInt) != 0 {
1976 if l.Op != Op386ANDLconst {
1979 c := auxIntToInt32(l.AuxInt)
1984 v.reset(Op386TESTBconst)
1985 v.AuxInt = int8ToAuxInt(int8(c))
1989 // match: (CMPBconst x [0])
1990 // result: (TESTB x x)
1992 if auxIntToInt8(v.AuxInt) != 0 {
2000 // match: (CMPBconst l:(MOVBload {sym} [off] ptr mem) [c])
2001 // cond: l.Uses == 1 && clobber(l)
2002 // result: @l.Block (CMPBconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2004 c := auxIntToInt8(v.AuxInt)
2006 if l.Op != Op386MOVBload {
2009 off := auxIntToInt32(l.AuxInt)
2010 sym := auxToSym(l.Aux)
2013 if !(l.Uses == 1 && clobber(l)) {
2017 v0 := b.NewValue0(l.Pos, Op386CMPBconstload, types.TypeFlags)
2019 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2020 v0.Aux = symToAux(sym)
2021 v0.AddArg2(ptr, mem)
2026 func rewriteValue386_Op386CMPBload(v *Value) bool {
2030 // match: (CMPBload {sym} [off] ptr (MOVLconst [c]) mem)
2031 // result: (CMPBconstload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
2033 off := auxIntToInt32(v.AuxInt)
2034 sym := auxToSym(v.Aux)
2036 if v_1.Op != Op386MOVLconst {
2039 c := auxIntToInt32(v_1.AuxInt)
2041 v.reset(Op386CMPBconstload)
2042 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int8(c)), off))
2043 v.Aux = symToAux(sym)
2049 func rewriteValue386_Op386CMPL(v *Value) bool {
2053 // match: (CMPL x (MOVLconst [c]))
2054 // result: (CMPLconst x [c])
2057 if v_1.Op != Op386MOVLconst {
2060 c := auxIntToInt32(v_1.AuxInt)
2061 v.reset(Op386CMPLconst)
2062 v.AuxInt = int32ToAuxInt(c)
2066 // match: (CMPL (MOVLconst [c]) x)
2067 // result: (InvertFlags (CMPLconst x [c]))
2069 if v_0.Op != Op386MOVLconst {
2072 c := auxIntToInt32(v_0.AuxInt)
2074 v.reset(Op386InvertFlags)
2075 v0 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
2076 v0.AuxInt = int32ToAuxInt(c)
2081 // match: (CMPL x y)
2082 // cond: canonLessThan(x,y)
2083 // result: (InvertFlags (CMPL y x))
2087 if !(canonLessThan(x, y)) {
2090 v.reset(Op386InvertFlags)
2091 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
2096 // match: (CMPL l:(MOVLload {sym} [off] ptr mem) x)
2097 // cond: canMergeLoad(v, l) && clobber(l)
2098 // result: (CMPLload {sym} [off] ptr x mem)
2101 if l.Op != Op386MOVLload {
2104 off := auxIntToInt32(l.AuxInt)
2105 sym := auxToSym(l.Aux)
2109 if !(canMergeLoad(v, l) && clobber(l)) {
2112 v.reset(Op386CMPLload)
2113 v.AuxInt = int32ToAuxInt(off)
2114 v.Aux = symToAux(sym)
2115 v.AddArg3(ptr, x, mem)
2118 // match: (CMPL x l:(MOVLload {sym} [off] ptr mem))
2119 // cond: canMergeLoad(v, l) && clobber(l)
2120 // result: (InvertFlags (CMPLload {sym} [off] ptr x mem))
2124 if l.Op != Op386MOVLload {
2127 off := auxIntToInt32(l.AuxInt)
2128 sym := auxToSym(l.Aux)
2131 if !(canMergeLoad(v, l) && clobber(l)) {
2134 v.reset(Op386InvertFlags)
2135 v0 := b.NewValue0(l.Pos, Op386CMPLload, types.TypeFlags)
2136 v0.AuxInt = int32ToAuxInt(off)
2137 v0.Aux = symToAux(sym)
2138 v0.AddArg3(ptr, x, mem)
2144 func rewriteValue386_Op386CMPLconst(v *Value) bool {
2147 // match: (CMPLconst (MOVLconst [x]) [y])
2151 y := auxIntToInt32(v.AuxInt)
2152 if v_0.Op != Op386MOVLconst {
2155 x := auxIntToInt32(v_0.AuxInt)
2159 v.reset(Op386FlagEQ)
2162 // match: (CMPLconst (MOVLconst [x]) [y])
2163 // cond: x<y && uint32(x)<uint32(y)
2164 // result: (FlagLT_ULT)
2166 y := auxIntToInt32(v.AuxInt)
2167 if v_0.Op != Op386MOVLconst {
2170 x := auxIntToInt32(v_0.AuxInt)
2171 if !(x < y && uint32(x) < uint32(y)) {
2174 v.reset(Op386FlagLT_ULT)
2177 // match: (CMPLconst (MOVLconst [x]) [y])
2178 // cond: x<y && uint32(x)>uint32(y)
2179 // result: (FlagLT_UGT)
2181 y := auxIntToInt32(v.AuxInt)
2182 if v_0.Op != Op386MOVLconst {
2185 x := auxIntToInt32(v_0.AuxInt)
2186 if !(x < y && uint32(x) > uint32(y)) {
2189 v.reset(Op386FlagLT_UGT)
2192 // match: (CMPLconst (MOVLconst [x]) [y])
2193 // cond: x>y && uint32(x)<uint32(y)
2194 // result: (FlagGT_ULT)
2196 y := auxIntToInt32(v.AuxInt)
2197 if v_0.Op != Op386MOVLconst {
2200 x := auxIntToInt32(v_0.AuxInt)
2201 if !(x > y && uint32(x) < uint32(y)) {
2204 v.reset(Op386FlagGT_ULT)
2207 // match: (CMPLconst (MOVLconst [x]) [y])
2208 // cond: x>y && uint32(x)>uint32(y)
2209 // result: (FlagGT_UGT)
2211 y := auxIntToInt32(v.AuxInt)
2212 if v_0.Op != Op386MOVLconst {
2215 x := auxIntToInt32(v_0.AuxInt)
2216 if !(x > y && uint32(x) > uint32(y)) {
2219 v.reset(Op386FlagGT_UGT)
2222 // match: (CMPLconst (SHRLconst _ [c]) [n])
2223 // cond: 0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)
2224 // result: (FlagLT_ULT)
2226 n := auxIntToInt32(v.AuxInt)
2227 if v_0.Op != Op386SHRLconst {
2230 c := auxIntToInt32(v_0.AuxInt)
2231 if !(0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)) {
2234 v.reset(Op386FlagLT_ULT)
2237 // match: (CMPLconst (ANDLconst _ [m]) [n])
2238 // cond: 0 <= m && m < n
2239 // result: (FlagLT_ULT)
2241 n := auxIntToInt32(v.AuxInt)
2242 if v_0.Op != Op386ANDLconst {
2245 m := auxIntToInt32(v_0.AuxInt)
2246 if !(0 <= m && m < n) {
2249 v.reset(Op386FlagLT_ULT)
2252 // match: (CMPLconst l:(ANDL x y) [0])
2254 // result: (TESTL x y)
2256 if auxIntToInt32(v.AuxInt) != 0 {
2260 if l.Op != Op386ANDL {
2272 // match: (CMPLconst l:(ANDLconst [c] x) [0])
2274 // result: (TESTLconst [c] x)
2276 if auxIntToInt32(v.AuxInt) != 0 {
2280 if l.Op != Op386ANDLconst {
2283 c := auxIntToInt32(l.AuxInt)
2288 v.reset(Op386TESTLconst)
2289 v.AuxInt = int32ToAuxInt(c)
2293 // match: (CMPLconst x [0])
2294 // result: (TESTL x x)
2296 if auxIntToInt32(v.AuxInt) != 0 {
2304 // match: (CMPLconst l:(MOVLload {sym} [off] ptr mem) [c])
2305 // cond: l.Uses == 1 && clobber(l)
2306 // result: @l.Block (CMPLconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2308 c := auxIntToInt32(v.AuxInt)
2310 if l.Op != Op386MOVLload {
2313 off := auxIntToInt32(l.AuxInt)
2314 sym := auxToSym(l.Aux)
2317 if !(l.Uses == 1 && clobber(l)) {
2321 v0 := b.NewValue0(l.Pos, Op386CMPLconstload, types.TypeFlags)
2323 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2324 v0.Aux = symToAux(sym)
2325 v0.AddArg2(ptr, mem)
2330 func rewriteValue386_Op386CMPLload(v *Value) bool {
2334 // match: (CMPLload {sym} [off] ptr (MOVLconst [c]) mem)
2335 // result: (CMPLconstload {sym} [makeValAndOff(c,off)] ptr mem)
2337 off := auxIntToInt32(v.AuxInt)
2338 sym := auxToSym(v.Aux)
2340 if v_1.Op != Op386MOVLconst {
2343 c := auxIntToInt32(v_1.AuxInt)
2345 v.reset(Op386CMPLconstload)
2346 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
2347 v.Aux = symToAux(sym)
2353 func rewriteValue386_Op386CMPW(v *Value) bool {
2357 // match: (CMPW x (MOVLconst [c]))
2358 // result: (CMPWconst x [int16(c)])
2361 if v_1.Op != Op386MOVLconst {
2364 c := auxIntToInt32(v_1.AuxInt)
2365 v.reset(Op386CMPWconst)
2366 v.AuxInt = int16ToAuxInt(int16(c))
2370 // match: (CMPW (MOVLconst [c]) x)
2371 // result: (InvertFlags (CMPWconst x [int16(c)]))
2373 if v_0.Op != Op386MOVLconst {
2376 c := auxIntToInt32(v_0.AuxInt)
2378 v.reset(Op386InvertFlags)
2379 v0 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
2380 v0.AuxInt = int16ToAuxInt(int16(c))
2385 // match: (CMPW x y)
2386 // cond: canonLessThan(x,y)
2387 // result: (InvertFlags (CMPW y x))
2391 if !(canonLessThan(x, y)) {
2394 v.reset(Op386InvertFlags)
2395 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
2400 // match: (CMPW l:(MOVWload {sym} [off] ptr mem) x)
2401 // cond: canMergeLoad(v, l) && clobber(l)
2402 // result: (CMPWload {sym} [off] ptr x mem)
2405 if l.Op != Op386MOVWload {
2408 off := auxIntToInt32(l.AuxInt)
2409 sym := auxToSym(l.Aux)
2413 if !(canMergeLoad(v, l) && clobber(l)) {
2416 v.reset(Op386CMPWload)
2417 v.AuxInt = int32ToAuxInt(off)
2418 v.Aux = symToAux(sym)
2419 v.AddArg3(ptr, x, mem)
2422 // match: (CMPW x l:(MOVWload {sym} [off] ptr mem))
2423 // cond: canMergeLoad(v, l) && clobber(l)
2424 // result: (InvertFlags (CMPWload {sym} [off] ptr x mem))
2428 if l.Op != Op386MOVWload {
2431 off := auxIntToInt32(l.AuxInt)
2432 sym := auxToSym(l.Aux)
2435 if !(canMergeLoad(v, l) && clobber(l)) {
2438 v.reset(Op386InvertFlags)
2439 v0 := b.NewValue0(l.Pos, Op386CMPWload, types.TypeFlags)
2440 v0.AuxInt = int32ToAuxInt(off)
2441 v0.Aux = symToAux(sym)
2442 v0.AddArg3(ptr, x, mem)
2448 func rewriteValue386_Op386CMPWconst(v *Value) bool {
2451 // match: (CMPWconst (MOVLconst [x]) [y])
2452 // cond: int16(x)==y
2455 y := auxIntToInt16(v.AuxInt)
2456 if v_0.Op != Op386MOVLconst {
2459 x := auxIntToInt32(v_0.AuxInt)
2460 if !(int16(x) == y) {
2463 v.reset(Op386FlagEQ)
2466 // match: (CMPWconst (MOVLconst [x]) [y])
2467 // cond: int16(x)<y && uint16(x)<uint16(y)
2468 // result: (FlagLT_ULT)
2470 y := auxIntToInt16(v.AuxInt)
2471 if v_0.Op != Op386MOVLconst {
2474 x := auxIntToInt32(v_0.AuxInt)
2475 if !(int16(x) < y && uint16(x) < uint16(y)) {
2478 v.reset(Op386FlagLT_ULT)
2481 // match: (CMPWconst (MOVLconst [x]) [y])
2482 // cond: int16(x)<y && uint16(x)>uint16(y)
2483 // result: (FlagLT_UGT)
2485 y := auxIntToInt16(v.AuxInt)
2486 if v_0.Op != Op386MOVLconst {
2489 x := auxIntToInt32(v_0.AuxInt)
2490 if !(int16(x) < y && uint16(x) > uint16(y)) {
2493 v.reset(Op386FlagLT_UGT)
2496 // match: (CMPWconst (MOVLconst [x]) [y])
2497 // cond: int16(x)>y && uint16(x)<uint16(y)
2498 // result: (FlagGT_ULT)
2500 y := auxIntToInt16(v.AuxInt)
2501 if v_0.Op != Op386MOVLconst {
2504 x := auxIntToInt32(v_0.AuxInt)
2505 if !(int16(x) > y && uint16(x) < uint16(y)) {
2508 v.reset(Op386FlagGT_ULT)
2511 // match: (CMPWconst (MOVLconst [x]) [y])
2512 // cond: int16(x)>y && uint16(x)>uint16(y)
2513 // result: (FlagGT_UGT)
2515 y := auxIntToInt16(v.AuxInt)
2516 if v_0.Op != Op386MOVLconst {
2519 x := auxIntToInt32(v_0.AuxInt)
2520 if !(int16(x) > y && uint16(x) > uint16(y)) {
2523 v.reset(Op386FlagGT_UGT)
2526 // match: (CMPWconst (ANDLconst _ [m]) [n])
2527 // cond: 0 <= int16(m) && int16(m) < n
2528 // result: (FlagLT_ULT)
2530 n := auxIntToInt16(v.AuxInt)
2531 if v_0.Op != Op386ANDLconst {
2534 m := auxIntToInt32(v_0.AuxInt)
2535 if !(0 <= int16(m) && int16(m) < n) {
2538 v.reset(Op386FlagLT_ULT)
2541 // match: (CMPWconst l:(ANDL x y) [0])
2543 // result: (TESTW x y)
2545 if auxIntToInt16(v.AuxInt) != 0 {
2549 if l.Op != Op386ANDL {
2561 // match: (CMPWconst l:(ANDLconst [c] x) [0])
2563 // result: (TESTWconst [int16(c)] x)
2565 if auxIntToInt16(v.AuxInt) != 0 {
2569 if l.Op != Op386ANDLconst {
2572 c := auxIntToInt32(l.AuxInt)
2577 v.reset(Op386TESTWconst)
2578 v.AuxInt = int16ToAuxInt(int16(c))
2582 // match: (CMPWconst x [0])
2583 // result: (TESTW x x)
2585 if auxIntToInt16(v.AuxInt) != 0 {
2593 // match: (CMPWconst l:(MOVWload {sym} [off] ptr mem) [c])
2594 // cond: l.Uses == 1 && clobber(l)
2595 // result: @l.Block (CMPWconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2597 c := auxIntToInt16(v.AuxInt)
2599 if l.Op != Op386MOVWload {
2602 off := auxIntToInt32(l.AuxInt)
2603 sym := auxToSym(l.Aux)
2606 if !(l.Uses == 1 && clobber(l)) {
2610 v0 := b.NewValue0(l.Pos, Op386CMPWconstload, types.TypeFlags)
2612 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2613 v0.Aux = symToAux(sym)
2614 v0.AddArg2(ptr, mem)
2619 func rewriteValue386_Op386CMPWload(v *Value) bool {
2623 // match: (CMPWload {sym} [off] ptr (MOVLconst [c]) mem)
2624 // result: (CMPWconstload {sym} [makeValAndOff(int32(int16(c)),off)] ptr mem)
2626 off := auxIntToInt32(v.AuxInt)
2627 sym := auxToSym(v.Aux)
2629 if v_1.Op != Op386MOVLconst {
2632 c := auxIntToInt32(v_1.AuxInt)
2634 v.reset(Op386CMPWconstload)
2635 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int16(c)), off))
2636 v.Aux = symToAux(sym)
2642 func rewriteValue386_Op386DIVSD(v *Value) bool {
2645 // match: (DIVSD x l:(MOVSDload [off] {sym} ptr mem))
2646 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
2647 // result: (DIVSDload x [off] {sym} ptr mem)
2651 if l.Op != Op386MOVSDload {
2654 off := auxIntToInt32(l.AuxInt)
2655 sym := auxToSym(l.Aux)
2658 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2661 v.reset(Op386DIVSDload)
2662 v.AuxInt = int32ToAuxInt(off)
2663 v.Aux = symToAux(sym)
2664 v.AddArg3(x, ptr, mem)
2669 func rewriteValue386_Op386DIVSDload(v *Value) bool {
2674 config := b.Func.Config
2675 // match: (DIVSDload [off1] {sym} val (ADDLconst [off2] base) mem)
2676 // cond: is32Bit(int64(off1)+int64(off2))
2677 // result: (DIVSDload [off1+off2] {sym} val base mem)
2679 off1 := auxIntToInt32(v.AuxInt)
2680 sym := auxToSym(v.Aux)
2682 if v_1.Op != Op386ADDLconst {
2685 off2 := auxIntToInt32(v_1.AuxInt)
2688 if !(is32Bit(int64(off1) + int64(off2))) {
2691 v.reset(Op386DIVSDload)
2692 v.AuxInt = int32ToAuxInt(off1 + off2)
2693 v.Aux = symToAux(sym)
2694 v.AddArg3(val, base, mem)
2697 // match: (DIVSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
2698 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
2699 // result: (DIVSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
2701 off1 := auxIntToInt32(v.AuxInt)
2702 sym1 := auxToSym(v.Aux)
2704 if v_1.Op != Op386LEAL {
2707 off2 := auxIntToInt32(v_1.AuxInt)
2708 sym2 := auxToSym(v_1.Aux)
2711 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2714 v.reset(Op386DIVSDload)
2715 v.AuxInt = int32ToAuxInt(off1 + off2)
2716 v.Aux = symToAux(mergeSym(sym1, sym2))
2717 v.AddArg3(val, base, mem)
2722 func rewriteValue386_Op386DIVSS(v *Value) bool {
2725 // match: (DIVSS x l:(MOVSSload [off] {sym} ptr mem))
2726 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
2727 // result: (DIVSSload x [off] {sym} ptr mem)
2731 if l.Op != Op386MOVSSload {
2734 off := auxIntToInt32(l.AuxInt)
2735 sym := auxToSym(l.Aux)
2738 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2741 v.reset(Op386DIVSSload)
2742 v.AuxInt = int32ToAuxInt(off)
2743 v.Aux = symToAux(sym)
2744 v.AddArg3(x, ptr, mem)
2749 func rewriteValue386_Op386DIVSSload(v *Value) bool {
2754 config := b.Func.Config
2755 // match: (DIVSSload [off1] {sym} val (ADDLconst [off2] base) mem)
2756 // cond: is32Bit(int64(off1)+int64(off2))
2757 // result: (DIVSSload [off1+off2] {sym} val base mem)
2759 off1 := auxIntToInt32(v.AuxInt)
2760 sym := auxToSym(v.Aux)
2762 if v_1.Op != Op386ADDLconst {
2765 off2 := auxIntToInt32(v_1.AuxInt)
2768 if !(is32Bit(int64(off1) + int64(off2))) {
2771 v.reset(Op386DIVSSload)
2772 v.AuxInt = int32ToAuxInt(off1 + off2)
2773 v.Aux = symToAux(sym)
2774 v.AddArg3(val, base, mem)
2777 // match: (DIVSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
2778 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
2779 // result: (DIVSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
2781 off1 := auxIntToInt32(v.AuxInt)
2782 sym1 := auxToSym(v.Aux)
2784 if v_1.Op != Op386LEAL {
2787 off2 := auxIntToInt32(v_1.AuxInt)
2788 sym2 := auxToSym(v_1.Aux)
2791 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2794 v.reset(Op386DIVSSload)
2795 v.AuxInt = int32ToAuxInt(off1 + off2)
2796 v.Aux = symToAux(mergeSym(sym1, sym2))
2797 v.AddArg3(val, base, mem)
2802 func rewriteValue386_Op386LEAL(v *Value) bool {
2804 // match: (LEAL [c] {s} (ADDLconst [d] x))
2805 // cond: is32Bit(int64(c)+int64(d))
2806 // result: (LEAL [c+d] {s} x)
2808 c := auxIntToInt32(v.AuxInt)
2809 s := auxToSym(v.Aux)
2810 if v_0.Op != Op386ADDLconst {
2813 d := auxIntToInt32(v_0.AuxInt)
2815 if !(is32Bit(int64(c) + int64(d))) {
2819 v.AuxInt = int32ToAuxInt(c + d)
2824 // match: (LEAL [c] {s} (ADDL x y))
2825 // cond: x.Op != OpSB && y.Op != OpSB
2826 // result: (LEAL1 [c] {s} x y)
2828 c := auxIntToInt32(v.AuxInt)
2829 s := auxToSym(v.Aux)
2830 if v_0.Op != Op386ADDL {
2834 v_0_0 := v_0.Args[0]
2835 v_0_1 := v_0.Args[1]
2836 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
2839 if !(x.Op != OpSB && y.Op != OpSB) {
2843 v.AuxInt = int32ToAuxInt(c)
2850 // match: (LEAL [off1] {sym1} (LEAL [off2] {sym2} x))
2851 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2852 // result: (LEAL [off1+off2] {mergeSym(sym1,sym2)} x)
2854 off1 := auxIntToInt32(v.AuxInt)
2855 sym1 := auxToSym(v.Aux)
2856 if v_0.Op != Op386LEAL {
2859 off2 := auxIntToInt32(v_0.AuxInt)
2860 sym2 := auxToSym(v_0.Aux)
2862 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2866 v.AuxInt = int32ToAuxInt(off1 + off2)
2867 v.Aux = symToAux(mergeSym(sym1, sym2))
2871 // match: (LEAL [off1] {sym1} (LEAL1 [off2] {sym2} x y))
2872 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2873 // result: (LEAL1 [off1+off2] {mergeSym(sym1,sym2)} x y)
2875 off1 := auxIntToInt32(v.AuxInt)
2876 sym1 := auxToSym(v.Aux)
2877 if v_0.Op != Op386LEAL1 {
2880 off2 := auxIntToInt32(v_0.AuxInt)
2881 sym2 := auxToSym(v_0.Aux)
2884 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2888 v.AuxInt = int32ToAuxInt(off1 + off2)
2889 v.Aux = symToAux(mergeSym(sym1, sym2))
2893 // match: (LEAL [off1] {sym1} (LEAL2 [off2] {sym2} x y))
2894 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2895 // result: (LEAL2 [off1+off2] {mergeSym(sym1,sym2)} x y)
2897 off1 := auxIntToInt32(v.AuxInt)
2898 sym1 := auxToSym(v.Aux)
2899 if v_0.Op != Op386LEAL2 {
2902 off2 := auxIntToInt32(v_0.AuxInt)
2903 sym2 := auxToSym(v_0.Aux)
2906 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2910 v.AuxInt = int32ToAuxInt(off1 + off2)
2911 v.Aux = symToAux(mergeSym(sym1, sym2))
2915 // match: (LEAL [off1] {sym1} (LEAL4 [off2] {sym2} x y))
2916 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2917 // result: (LEAL4 [off1+off2] {mergeSym(sym1,sym2)} x y)
2919 off1 := auxIntToInt32(v.AuxInt)
2920 sym1 := auxToSym(v.Aux)
2921 if v_0.Op != Op386LEAL4 {
2924 off2 := auxIntToInt32(v_0.AuxInt)
2925 sym2 := auxToSym(v_0.Aux)
2928 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2932 v.AuxInt = int32ToAuxInt(off1 + off2)
2933 v.Aux = symToAux(mergeSym(sym1, sym2))
2937 // match: (LEAL [off1] {sym1} (LEAL8 [off2] {sym2} x y))
2938 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2939 // result: (LEAL8 [off1+off2] {mergeSym(sym1,sym2)} x y)
2941 off1 := auxIntToInt32(v.AuxInt)
2942 sym1 := auxToSym(v.Aux)
2943 if v_0.Op != Op386LEAL8 {
2946 off2 := auxIntToInt32(v_0.AuxInt)
2947 sym2 := auxToSym(v_0.Aux)
2950 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2954 v.AuxInt = int32ToAuxInt(off1 + off2)
2955 v.Aux = symToAux(mergeSym(sym1, sym2))
2961 func rewriteValue386_Op386LEAL1(v *Value) bool {
2964 // match: (LEAL1 [c] {s} (ADDLconst [d] x) y)
2965 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
2966 // result: (LEAL1 [c+d] {s} x y)
2968 c := auxIntToInt32(v.AuxInt)
2969 s := auxToSym(v.Aux)
2970 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2971 if v_0.Op != Op386ADDLconst {
2974 d := auxIntToInt32(v_0.AuxInt)
2977 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
2981 v.AuxInt = int32ToAuxInt(c + d)
2988 // match: (LEAL1 [c] {s} x (SHLLconst [1] y))
2989 // result: (LEAL2 [c] {s} x y)
2991 c := auxIntToInt32(v.AuxInt)
2992 s := auxToSym(v.Aux)
2993 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2995 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3000 v.AuxInt = int32ToAuxInt(c)
3007 // match: (LEAL1 [c] {s} x (SHLLconst [2] y))
3008 // result: (LEAL4 [c] {s} x y)
3010 c := auxIntToInt32(v.AuxInt)
3011 s := auxToSym(v.Aux)
3012 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3014 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
3019 v.AuxInt = int32ToAuxInt(c)
3026 // match: (LEAL1 [c] {s} x (SHLLconst [3] y))
3027 // result: (LEAL8 [c] {s} x y)
3029 c := auxIntToInt32(v.AuxInt)
3030 s := auxToSym(v.Aux)
3031 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3033 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
3038 v.AuxInt = int32ToAuxInt(c)
3045 // match: (LEAL1 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3046 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3047 // result: (LEAL1 [off1+off2] {mergeSym(sym1,sym2)} x y)
3049 off1 := auxIntToInt32(v.AuxInt)
3050 sym1 := auxToSym(v.Aux)
3051 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3052 if v_0.Op != Op386LEAL {
3055 off2 := auxIntToInt32(v_0.AuxInt)
3056 sym2 := auxToSym(v_0.Aux)
3059 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3063 v.AuxInt = int32ToAuxInt(off1 + off2)
3064 v.Aux = symToAux(mergeSym(sym1, sym2))
3070 // match: (LEAL1 [off1] {sym1} x (LEAL1 [off2] {sym2} y y))
3071 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
3072 // result: (LEAL2 [off1+off2] {mergeSym(sym1, sym2)} x y)
3074 off1 := auxIntToInt32(v.AuxInt)
3075 sym1 := auxToSym(v.Aux)
3076 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3078 if v_1.Op != Op386LEAL1 {
3081 off2 := auxIntToInt32(v_1.AuxInt)
3082 sym2 := auxToSym(v_1.Aux)
3084 if y != v_1.Args[0] || !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3088 v.AuxInt = int32ToAuxInt(off1 + off2)
3089 v.Aux = symToAux(mergeSym(sym1, sym2))
3095 // match: (LEAL1 [off1] {sym1} x (LEAL1 [off2] {sym2} x y))
3096 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
3097 // result: (LEAL2 [off1+off2] {mergeSym(sym1, sym2)} y x)
3099 off1 := auxIntToInt32(v.AuxInt)
3100 sym1 := auxToSym(v.Aux)
3101 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3103 if v_1.Op != Op386LEAL1 {
3106 off2 := auxIntToInt32(v_1.AuxInt)
3107 sym2 := auxToSym(v_1.Aux)
3109 v_1_0 := v_1.Args[0]
3110 v_1_1 := v_1.Args[1]
3111 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3116 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3120 v.AuxInt = int32ToAuxInt(off1 + off2)
3121 v.Aux = symToAux(mergeSym(sym1, sym2))
3128 // match: (LEAL1 [0] {nil} x y)
3129 // result: (ADDL x y)
3131 if auxIntToInt32(v.AuxInt) != 0 || auxToSym(v.Aux) != nil {
3142 func rewriteValue386_Op386LEAL2(v *Value) bool {
3145 // match: (LEAL2 [c] {s} (ADDLconst [d] x) y)
3146 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3147 // result: (LEAL2 [c+d] {s} x y)
3149 c := auxIntToInt32(v.AuxInt)
3150 s := auxToSym(v.Aux)
3151 if v_0.Op != Op386ADDLconst {
3154 d := auxIntToInt32(v_0.AuxInt)
3157 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3161 v.AuxInt = int32ToAuxInt(c + d)
3166 // match: (LEAL2 [c] {s} x (ADDLconst [d] y))
3167 // cond: is32Bit(int64(c)+2*int64(d)) && y.Op != OpSB
3168 // result: (LEAL2 [c+2*d] {s} x y)
3170 c := auxIntToInt32(v.AuxInt)
3171 s := auxToSym(v.Aux)
3173 if v_1.Op != Op386ADDLconst {
3176 d := auxIntToInt32(v_1.AuxInt)
3178 if !(is32Bit(int64(c)+2*int64(d)) && y.Op != OpSB) {
3182 v.AuxInt = int32ToAuxInt(c + 2*d)
3187 // match: (LEAL2 [c] {s} x (SHLLconst [1] y))
3188 // result: (LEAL4 [c] {s} x y)
3190 c := auxIntToInt32(v.AuxInt)
3191 s := auxToSym(v.Aux)
3193 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3198 v.AuxInt = int32ToAuxInt(c)
3203 // match: (LEAL2 [c] {s} x (SHLLconst [2] y))
3204 // result: (LEAL8 [c] {s} x y)
3206 c := auxIntToInt32(v.AuxInt)
3207 s := auxToSym(v.Aux)
3209 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
3214 v.AuxInt = int32ToAuxInt(c)
3219 // match: (LEAL2 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3220 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3221 // result: (LEAL2 [off1+off2] {mergeSym(sym1,sym2)} x y)
3223 off1 := auxIntToInt32(v.AuxInt)
3224 sym1 := auxToSym(v.Aux)
3225 if v_0.Op != Op386LEAL {
3228 off2 := auxIntToInt32(v_0.AuxInt)
3229 sym2 := auxToSym(v_0.Aux)
3232 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3236 v.AuxInt = int32ToAuxInt(off1 + off2)
3237 v.Aux = symToAux(mergeSym(sym1, sym2))
3241 // match: (LEAL2 [off1] {sym} x (LEAL1 [off2] {nil} y y))
3242 // cond: is32Bit(int64(off1)+2*int64(off2))
3243 // result: (LEAL4 [off1+2*off2] {sym} x y)
3245 off1 := auxIntToInt32(v.AuxInt)
3246 sym := auxToSym(v.Aux)
3248 if v_1.Op != Op386LEAL1 {
3251 off2 := auxIntToInt32(v_1.AuxInt)
3252 if auxToSym(v_1.Aux) != nil {
3256 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 2*int64(off2))) {
3260 v.AuxInt = int32ToAuxInt(off1 + 2*off2)
3261 v.Aux = symToAux(sym)
3267 func rewriteValue386_Op386LEAL4(v *Value) bool {
3270 // match: (LEAL4 [c] {s} (ADDLconst [d] x) y)
3271 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3272 // result: (LEAL4 [c+d] {s} x y)
3274 c := auxIntToInt32(v.AuxInt)
3275 s := auxToSym(v.Aux)
3276 if v_0.Op != Op386ADDLconst {
3279 d := auxIntToInt32(v_0.AuxInt)
3282 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3286 v.AuxInt = int32ToAuxInt(c + d)
3291 // match: (LEAL4 [c] {s} x (ADDLconst [d] y))
3292 // cond: is32Bit(int64(c)+4*int64(d)) && y.Op != OpSB
3293 // result: (LEAL4 [c+4*d] {s} x y)
3295 c := auxIntToInt32(v.AuxInt)
3296 s := auxToSym(v.Aux)
3298 if v_1.Op != Op386ADDLconst {
3301 d := auxIntToInt32(v_1.AuxInt)
3303 if !(is32Bit(int64(c)+4*int64(d)) && y.Op != OpSB) {
3307 v.AuxInt = int32ToAuxInt(c + 4*d)
3312 // match: (LEAL4 [c] {s} x (SHLLconst [1] y))
3313 // result: (LEAL8 [c] {s} x y)
3315 c := auxIntToInt32(v.AuxInt)
3316 s := auxToSym(v.Aux)
3318 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3323 v.AuxInt = int32ToAuxInt(c)
3328 // match: (LEAL4 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3329 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3330 // result: (LEAL4 [off1+off2] {mergeSym(sym1,sym2)} x y)
3332 off1 := auxIntToInt32(v.AuxInt)
3333 sym1 := auxToSym(v.Aux)
3334 if v_0.Op != Op386LEAL {
3337 off2 := auxIntToInt32(v_0.AuxInt)
3338 sym2 := auxToSym(v_0.Aux)
3341 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3345 v.AuxInt = int32ToAuxInt(off1 + off2)
3346 v.Aux = symToAux(mergeSym(sym1, sym2))
3350 // match: (LEAL4 [off1] {sym} x (LEAL1 [off2] {nil} y y))
3351 // cond: is32Bit(int64(off1)+4*int64(off2))
3352 // result: (LEAL8 [off1+4*off2] {sym} x y)
3354 off1 := auxIntToInt32(v.AuxInt)
3355 sym := auxToSym(v.Aux)
3357 if v_1.Op != Op386LEAL1 {
3360 off2 := auxIntToInt32(v_1.AuxInt)
3361 if auxToSym(v_1.Aux) != nil {
3365 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 4*int64(off2))) {
3369 v.AuxInt = int32ToAuxInt(off1 + 4*off2)
3370 v.Aux = symToAux(sym)
3376 func rewriteValue386_Op386LEAL8(v *Value) bool {
3379 // match: (LEAL8 [c] {s} (ADDLconst [d] x) y)
3380 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3381 // result: (LEAL8 [c+d] {s} x y)
3383 c := auxIntToInt32(v.AuxInt)
3384 s := auxToSym(v.Aux)
3385 if v_0.Op != Op386ADDLconst {
3388 d := auxIntToInt32(v_0.AuxInt)
3391 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3395 v.AuxInt = int32ToAuxInt(c + d)
3400 // match: (LEAL8 [c] {s} x (ADDLconst [d] y))
3401 // cond: is32Bit(int64(c)+8*int64(d)) && y.Op != OpSB
3402 // result: (LEAL8 [c+8*d] {s} x y)
3404 c := auxIntToInt32(v.AuxInt)
3405 s := auxToSym(v.Aux)
3407 if v_1.Op != Op386ADDLconst {
3410 d := auxIntToInt32(v_1.AuxInt)
3412 if !(is32Bit(int64(c)+8*int64(d)) && y.Op != OpSB) {
3416 v.AuxInt = int32ToAuxInt(c + 8*d)
3421 // match: (LEAL8 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3422 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3423 // result: (LEAL8 [off1+off2] {mergeSym(sym1,sym2)} x y)
3425 off1 := auxIntToInt32(v.AuxInt)
3426 sym1 := auxToSym(v.Aux)
3427 if v_0.Op != Op386LEAL {
3430 off2 := auxIntToInt32(v_0.AuxInt)
3431 sym2 := auxToSym(v_0.Aux)
3434 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3438 v.AuxInt = int32ToAuxInt(off1 + off2)
3439 v.Aux = symToAux(mergeSym(sym1, sym2))
3445 func rewriteValue386_Op386MOVBLSX(v *Value) bool {
3448 // match: (MOVBLSX x:(MOVBload [off] {sym} ptr mem))
3449 // cond: x.Uses == 1 && clobber(x)
3450 // result: @x.Block (MOVBLSXload <v.Type> [off] {sym} ptr mem)
3453 if x.Op != Op386MOVBload {
3456 off := auxIntToInt32(x.AuxInt)
3457 sym := auxToSym(x.Aux)
3460 if !(x.Uses == 1 && clobber(x)) {
3464 v0 := b.NewValue0(x.Pos, Op386MOVBLSXload, v.Type)
3466 v0.AuxInt = int32ToAuxInt(off)
3467 v0.Aux = symToAux(sym)
3468 v0.AddArg2(ptr, mem)
3471 // match: (MOVBLSX (ANDLconst [c] x))
3472 // cond: c & 0x80 == 0
3473 // result: (ANDLconst [c & 0x7f] x)
3475 if v_0.Op != Op386ANDLconst {
3478 c := auxIntToInt32(v_0.AuxInt)
3483 v.reset(Op386ANDLconst)
3484 v.AuxInt = int32ToAuxInt(c & 0x7f)
3490 func rewriteValue386_Op386MOVBLSXload(v *Value) bool {
3494 config := b.Func.Config
3495 // match: (MOVBLSXload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
3496 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
3497 // result: (MOVBLSX x)
3499 off := auxIntToInt32(v.AuxInt)
3500 sym := auxToSym(v.Aux)
3502 if v_1.Op != Op386MOVBstore {
3505 off2 := auxIntToInt32(v_1.AuxInt)
3506 sym2 := auxToSym(v_1.Aux)
3509 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3512 v.reset(Op386MOVBLSX)
3516 // match: (MOVBLSXload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
3517 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3518 // result: (MOVBLSXload [off1+off2] {mergeSym(sym1,sym2)} base mem)
3520 off1 := auxIntToInt32(v.AuxInt)
3521 sym1 := auxToSym(v.Aux)
3522 if v_0.Op != Op386LEAL {
3525 off2 := auxIntToInt32(v_0.AuxInt)
3526 sym2 := auxToSym(v_0.Aux)
3529 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3532 v.reset(Op386MOVBLSXload)
3533 v.AuxInt = int32ToAuxInt(off1 + off2)
3534 v.Aux = symToAux(mergeSym(sym1, sym2))
3535 v.AddArg2(base, mem)
3540 func rewriteValue386_Op386MOVBLZX(v *Value) bool {
3543 // match: (MOVBLZX x:(MOVBload [off] {sym} ptr mem))
3544 // cond: x.Uses == 1 && clobber(x)
3545 // result: @x.Block (MOVBload <v.Type> [off] {sym} ptr mem)
3548 if x.Op != Op386MOVBload {
3551 off := auxIntToInt32(x.AuxInt)
3552 sym := auxToSym(x.Aux)
3555 if !(x.Uses == 1 && clobber(x)) {
3559 v0 := b.NewValue0(x.Pos, Op386MOVBload, v.Type)
3561 v0.AuxInt = int32ToAuxInt(off)
3562 v0.Aux = symToAux(sym)
3563 v0.AddArg2(ptr, mem)
3566 // match: (MOVBLZX (ANDLconst [c] x))
3567 // result: (ANDLconst [c & 0xff] x)
3569 if v_0.Op != Op386ANDLconst {
3572 c := auxIntToInt32(v_0.AuxInt)
3574 v.reset(Op386ANDLconst)
3575 v.AuxInt = int32ToAuxInt(c & 0xff)
3581 func rewriteValue386_Op386MOVBload(v *Value) bool {
3585 config := b.Func.Config
3586 // match: (MOVBload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
3587 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
3588 // result: (MOVBLZX x)
3590 off := auxIntToInt32(v.AuxInt)
3591 sym := auxToSym(v.Aux)
3593 if v_1.Op != Op386MOVBstore {
3596 off2 := auxIntToInt32(v_1.AuxInt)
3597 sym2 := auxToSym(v_1.Aux)
3600 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3603 v.reset(Op386MOVBLZX)
3607 // match: (MOVBload [off1] {sym} (ADDLconst [off2] ptr) mem)
3608 // cond: is32Bit(int64(off1)+int64(off2))
3609 // result: (MOVBload [off1+off2] {sym} ptr mem)
3611 off1 := auxIntToInt32(v.AuxInt)
3612 sym := auxToSym(v.Aux)
3613 if v_0.Op != Op386ADDLconst {
3616 off2 := auxIntToInt32(v_0.AuxInt)
3619 if !(is32Bit(int64(off1) + int64(off2))) {
3622 v.reset(Op386MOVBload)
3623 v.AuxInt = int32ToAuxInt(off1 + off2)
3624 v.Aux = symToAux(sym)
3628 // match: (MOVBload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
3629 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3630 // result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} base mem)
3632 off1 := auxIntToInt32(v.AuxInt)
3633 sym1 := auxToSym(v.Aux)
3634 if v_0.Op != Op386LEAL {
3637 off2 := auxIntToInt32(v_0.AuxInt)
3638 sym2 := auxToSym(v_0.Aux)
3641 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3644 v.reset(Op386MOVBload)
3645 v.AuxInt = int32ToAuxInt(off1 + off2)
3646 v.Aux = symToAux(mergeSym(sym1, sym2))
3647 v.AddArg2(base, mem)
3650 // match: (MOVBload [off] {sym} (SB) _)
3651 // cond: symIsRO(sym)
3652 // result: (MOVLconst [int32(read8(sym, int64(off)))])
3654 off := auxIntToInt32(v.AuxInt)
3655 sym := auxToSym(v.Aux)
3656 if v_0.Op != OpSB || !(symIsRO(sym)) {
3659 v.reset(Op386MOVLconst)
3660 v.AuxInt = int32ToAuxInt(int32(read8(sym, int64(off))))
3665 func rewriteValue386_Op386MOVBstore(v *Value) bool {
3670 config := b.Func.Config
3671 // match: (MOVBstore [off] {sym} ptr (MOVBLSX x) mem)
3672 // result: (MOVBstore [off] {sym} ptr x mem)
3674 off := auxIntToInt32(v.AuxInt)
3675 sym := auxToSym(v.Aux)
3677 if v_1.Op != Op386MOVBLSX {
3682 v.reset(Op386MOVBstore)
3683 v.AuxInt = int32ToAuxInt(off)
3684 v.Aux = symToAux(sym)
3685 v.AddArg3(ptr, x, mem)
3688 // match: (MOVBstore [off] {sym} ptr (MOVBLZX x) mem)
3689 // result: (MOVBstore [off] {sym} ptr x mem)
3691 off := auxIntToInt32(v.AuxInt)
3692 sym := auxToSym(v.Aux)
3694 if v_1.Op != Op386MOVBLZX {
3699 v.reset(Op386MOVBstore)
3700 v.AuxInt = int32ToAuxInt(off)
3701 v.Aux = symToAux(sym)
3702 v.AddArg3(ptr, x, mem)
3705 // match: (MOVBstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
3706 // cond: is32Bit(int64(off1)+int64(off2))
3707 // result: (MOVBstore [off1+off2] {sym} ptr val mem)
3709 off1 := auxIntToInt32(v.AuxInt)
3710 sym := auxToSym(v.Aux)
3711 if v_0.Op != Op386ADDLconst {
3714 off2 := auxIntToInt32(v_0.AuxInt)
3718 if !(is32Bit(int64(off1) + int64(off2))) {
3721 v.reset(Op386MOVBstore)
3722 v.AuxInt = int32ToAuxInt(off1 + off2)
3723 v.Aux = symToAux(sym)
3724 v.AddArg3(ptr, val, mem)
3727 // match: (MOVBstore [off] {sym} ptr (MOVLconst [c]) mem)
3728 // result: (MOVBstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
3730 off := auxIntToInt32(v.AuxInt)
3731 sym := auxToSym(v.Aux)
3733 if v_1.Op != Op386MOVLconst {
3736 c := auxIntToInt32(v_1.AuxInt)
3738 v.reset(Op386MOVBstoreconst)
3739 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
3740 v.Aux = symToAux(sym)
3744 // match: (MOVBstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
3745 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3746 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
3748 off1 := auxIntToInt32(v.AuxInt)
3749 sym1 := auxToSym(v.Aux)
3750 if v_0.Op != Op386LEAL {
3753 off2 := auxIntToInt32(v_0.AuxInt)
3754 sym2 := auxToSym(v_0.Aux)
3758 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3761 v.reset(Op386MOVBstore)
3762 v.AuxInt = int32ToAuxInt(off1 + off2)
3763 v.Aux = symToAux(mergeSym(sym1, sym2))
3764 v.AddArg3(base, val, mem)
3767 // match: (MOVBstore [i] {s} p (SHRWconst [8] w) x:(MOVBstore [i-1] {s} p w mem))
3768 // cond: x.Uses == 1 && clobber(x)
3769 // result: (MOVWstore [i-1] {s} p w mem)
3771 i := auxIntToInt32(v.AuxInt)
3772 s := auxToSym(v.Aux)
3774 if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
3779 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3783 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
3786 v.reset(Op386MOVWstore)
3787 v.AuxInt = int32ToAuxInt(i - 1)
3789 v.AddArg3(p, w, mem)
3792 // match: (MOVBstore [i] {s} p (SHRLconst [8] w) x:(MOVBstore [i-1] {s} p w mem))
3793 // cond: x.Uses == 1 && clobber(x)
3794 // result: (MOVWstore [i-1] {s} p w mem)
3796 i := auxIntToInt32(v.AuxInt)
3797 s := auxToSym(v.Aux)
3799 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
3804 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3808 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
3811 v.reset(Op386MOVWstore)
3812 v.AuxInt = int32ToAuxInt(i - 1)
3814 v.AddArg3(p, w, mem)
3817 // match: (MOVBstore [i] {s} p w x:(MOVBstore {s} [i+1] p (SHRWconst [8] w) mem))
3818 // cond: x.Uses == 1 && clobber(x)
3819 // result: (MOVWstore [i] {s} p w mem)
3821 i := auxIntToInt32(v.AuxInt)
3822 s := auxToSym(v.Aux)
3826 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
3834 if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
3837 v.reset(Op386MOVWstore)
3838 v.AuxInt = int32ToAuxInt(i)
3840 v.AddArg3(p, w, mem)
3843 // match: (MOVBstore [i] {s} p w x:(MOVBstore {s} [i+1] p (SHRLconst [8] w) mem))
3844 // cond: x.Uses == 1 && clobber(x)
3845 // result: (MOVWstore [i] {s} p w mem)
3847 i := auxIntToInt32(v.AuxInt)
3848 s := auxToSym(v.Aux)
3852 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
3860 if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
3863 v.reset(Op386MOVWstore)
3864 v.AuxInt = int32ToAuxInt(i)
3866 v.AddArg3(p, w, mem)
3869 // match: (MOVBstore [i] {s} p (SHRLconst [j] w) x:(MOVBstore [i-1] {s} p w0:(SHRLconst [j-8] w) mem))
3870 // cond: x.Uses == 1 && clobber(x)
3871 // result: (MOVWstore [i-1] {s} p w0 mem)
3873 i := auxIntToInt32(v.AuxInt)
3874 s := auxToSym(v.Aux)
3876 if v_1.Op != Op386SHRLconst {
3879 j := auxIntToInt32(v_1.AuxInt)
3882 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3890 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
3893 v.reset(Op386MOVWstore)
3894 v.AuxInt = int32ToAuxInt(i - 1)
3896 v.AddArg3(p, w0, mem)
3899 // match: (MOVBstore [i] {s} p1 (SHRWconst [8] w) x:(MOVBstore [i] {s} p0 w mem))
3900 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3901 // result: (MOVWstore [i] {s} p0 w mem)
3903 i := auxIntToInt32(v.AuxInt)
3904 s := auxToSym(v.Aux)
3906 if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
3911 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3916 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3919 v.reset(Op386MOVWstore)
3920 v.AuxInt = int32ToAuxInt(i)
3922 v.AddArg3(p0, w, mem)
3925 // match: (MOVBstore [i] {s} p1 (SHRLconst [8] w) x:(MOVBstore [i] {s} p0 w mem))
3926 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3927 // result: (MOVWstore [i] {s} p0 w mem)
3929 i := auxIntToInt32(v.AuxInt)
3930 s := auxToSym(v.Aux)
3932 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
3937 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3942 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3945 v.reset(Op386MOVWstore)
3946 v.AuxInt = int32ToAuxInt(i)
3948 v.AddArg3(p0, w, mem)
3951 // match: (MOVBstore [i] {s} p0 w x:(MOVBstore {s} [i] p1 (SHRWconst [8] w) mem))
3952 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3953 // result: (MOVWstore [i] {s} p0 w mem)
3955 i := auxIntToInt32(v.AuxInt)
3956 s := auxToSym(v.Aux)
3960 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3966 if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3969 v.reset(Op386MOVWstore)
3970 v.AuxInt = int32ToAuxInt(i)
3972 v.AddArg3(p0, w, mem)
3975 // match: (MOVBstore [i] {s} p0 w x:(MOVBstore {s} [i] p1 (SHRLconst [8] w) mem))
3976 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3977 // result: (MOVWstore [i] {s} p0 w mem)
3979 i := auxIntToInt32(v.AuxInt)
3980 s := auxToSym(v.Aux)
3984 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3990 if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3993 v.reset(Op386MOVWstore)
3994 v.AuxInt = int32ToAuxInt(i)
3996 v.AddArg3(p0, w, mem)
3999 // match: (MOVBstore [i] {s} p1 (SHRLconst [j] w) x:(MOVBstore [i] {s} p0 w0:(SHRLconst [j-8] w) mem))
4000 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
4001 // result: (MOVWstore [i] {s} p0 w0 mem)
4003 i := auxIntToInt32(v.AuxInt)
4004 s := auxToSym(v.Aux)
4006 if v_1.Op != Op386SHRLconst {
4009 j := auxIntToInt32(v_1.AuxInt)
4012 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
4018 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4021 v.reset(Op386MOVWstore)
4022 v.AuxInt = int32ToAuxInt(i)
4024 v.AddArg3(p0, w0, mem)
4029 func rewriteValue386_Op386MOVBstoreconst(v *Value) bool {
4033 config := b.Func.Config
4034 // match: (MOVBstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
4035 // cond: sc.canAdd32(off)
4036 // result: (MOVBstoreconst [sc.addOffset32(off)] {s} ptr mem)
4038 sc := auxIntToValAndOff(v.AuxInt)
4039 s := auxToSym(v.Aux)
4040 if v_0.Op != Op386ADDLconst {
4043 off := auxIntToInt32(v_0.AuxInt)
4046 if !(sc.canAdd32(off)) {
4049 v.reset(Op386MOVBstoreconst)
4050 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4055 // match: (MOVBstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
4056 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4057 // result: (MOVBstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
4059 sc := auxIntToValAndOff(v.AuxInt)
4060 sym1 := auxToSym(v.Aux)
4061 if v_0.Op != Op386LEAL {
4064 off := auxIntToInt32(v_0.AuxInt)
4065 sym2 := auxToSym(v_0.Aux)
4068 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4071 v.reset(Op386MOVBstoreconst)
4072 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4073 v.Aux = symToAux(mergeSym(sym1, sym2))
4077 // match: (MOVBstoreconst [c] {s} p x:(MOVBstoreconst [a] {s} p mem))
4078 // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
4079 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p mem)
4081 c := auxIntToValAndOff(v.AuxInt)
4082 s := auxToSym(v.Aux)
4085 if x.Op != Op386MOVBstoreconst {
4088 a := auxIntToValAndOff(x.AuxInt)
4089 if auxToSym(x.Aux) != s {
4093 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
4096 v.reset(Op386MOVWstoreconst)
4097 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4102 // match: (MOVBstoreconst [a] {s} p x:(MOVBstoreconst [c] {s} p mem))
4103 // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
4104 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p mem)
4106 a := auxIntToValAndOff(v.AuxInt)
4107 s := auxToSym(v.Aux)
4110 if x.Op != Op386MOVBstoreconst {
4113 c := auxIntToValAndOff(x.AuxInt)
4114 if auxToSym(x.Aux) != s {
4118 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
4121 v.reset(Op386MOVWstoreconst)
4122 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4127 // match: (MOVBstoreconst [c] {s} p1 x:(MOVBstoreconst [a] {s} p0 mem))
4128 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
4129 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p0 mem)
4131 c := auxIntToValAndOff(v.AuxInt)
4132 s := auxToSym(v.Aux)
4135 if x.Op != Op386MOVBstoreconst {
4138 a := auxIntToValAndOff(x.AuxInt)
4139 if auxToSym(x.Aux) != s {
4144 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4147 v.reset(Op386MOVWstoreconst)
4148 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4153 // match: (MOVBstoreconst [a] {s} p0 x:(MOVBstoreconst [c] {s} p1 mem))
4154 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
4155 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p0 mem)
4157 a := auxIntToValAndOff(v.AuxInt)
4158 s := auxToSym(v.Aux)
4161 if x.Op != Op386MOVBstoreconst {
4164 c := auxIntToValAndOff(x.AuxInt)
4165 if auxToSym(x.Aux) != s {
4170 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4173 v.reset(Op386MOVWstoreconst)
4174 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4181 func rewriteValue386_Op386MOVLload(v *Value) bool {
4185 config := b.Func.Config
4186 // match: (MOVLload [off] {sym} ptr (MOVLstore [off2] {sym2} ptr2 x _))
4187 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
4190 off := auxIntToInt32(v.AuxInt)
4191 sym := auxToSym(v.Aux)
4193 if v_1.Op != Op386MOVLstore {
4196 off2 := auxIntToInt32(v_1.AuxInt)
4197 sym2 := auxToSym(v_1.Aux)
4200 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
4206 // match: (MOVLload [off1] {sym} (ADDLconst [off2] ptr) mem)
4207 // cond: is32Bit(int64(off1)+int64(off2))
4208 // result: (MOVLload [off1+off2] {sym} ptr mem)
4210 off1 := auxIntToInt32(v.AuxInt)
4211 sym := auxToSym(v.Aux)
4212 if v_0.Op != Op386ADDLconst {
4215 off2 := auxIntToInt32(v_0.AuxInt)
4218 if !(is32Bit(int64(off1) + int64(off2))) {
4221 v.reset(Op386MOVLload)
4222 v.AuxInt = int32ToAuxInt(off1 + off2)
4223 v.Aux = symToAux(sym)
4227 // match: (MOVLload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4228 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4229 // result: (MOVLload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4231 off1 := auxIntToInt32(v.AuxInt)
4232 sym1 := auxToSym(v.Aux)
4233 if v_0.Op != Op386LEAL {
4236 off2 := auxIntToInt32(v_0.AuxInt)
4237 sym2 := auxToSym(v_0.Aux)
4240 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4243 v.reset(Op386MOVLload)
4244 v.AuxInt = int32ToAuxInt(off1 + off2)
4245 v.Aux = symToAux(mergeSym(sym1, sym2))
4246 v.AddArg2(base, mem)
4249 // match: (MOVLload [off] {sym} (SB) _)
4250 // cond: symIsRO(sym)
4251 // result: (MOVLconst [int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
4253 off := auxIntToInt32(v.AuxInt)
4254 sym := auxToSym(v.Aux)
4255 if v_0.Op != OpSB || !(symIsRO(sym)) {
4258 v.reset(Op386MOVLconst)
4259 v.AuxInt = int32ToAuxInt(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
4264 func rewriteValue386_Op386MOVLstore(v *Value) bool {
4269 config := b.Func.Config
4270 // match: (MOVLstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4271 // cond: is32Bit(int64(off1)+int64(off2))
4272 // result: (MOVLstore [off1+off2] {sym} ptr val mem)
4274 off1 := auxIntToInt32(v.AuxInt)
4275 sym := auxToSym(v.Aux)
4276 if v_0.Op != Op386ADDLconst {
4279 off2 := auxIntToInt32(v_0.AuxInt)
4283 if !(is32Bit(int64(off1) + int64(off2))) {
4286 v.reset(Op386MOVLstore)
4287 v.AuxInt = int32ToAuxInt(off1 + off2)
4288 v.Aux = symToAux(sym)
4289 v.AddArg3(ptr, val, mem)
4292 // match: (MOVLstore [off] {sym} ptr (MOVLconst [c]) mem)
4293 // result: (MOVLstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
4295 off := auxIntToInt32(v.AuxInt)
4296 sym := auxToSym(v.Aux)
4298 if v_1.Op != Op386MOVLconst {
4301 c := auxIntToInt32(v_1.AuxInt)
4303 v.reset(Op386MOVLstoreconst)
4304 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4305 v.Aux = symToAux(sym)
4309 // match: (MOVLstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4310 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4311 // result: (MOVLstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4313 off1 := auxIntToInt32(v.AuxInt)
4314 sym1 := auxToSym(v.Aux)
4315 if v_0.Op != Op386LEAL {
4318 off2 := auxIntToInt32(v_0.AuxInt)
4319 sym2 := auxToSym(v_0.Aux)
4323 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4326 v.reset(Op386MOVLstore)
4327 v.AuxInt = int32ToAuxInt(off1 + off2)
4328 v.Aux = symToAux(mergeSym(sym1, sym2))
4329 v.AddArg3(base, val, mem)
4332 // match: (MOVLstore {sym} [off] ptr y:(ADDLload x [off] {sym} ptr mem) mem)
4333 // cond: y.Uses==1 && clobber(y)
4334 // result: (ADDLmodify [off] {sym} ptr x mem)
4336 off := auxIntToInt32(v.AuxInt)
4337 sym := auxToSym(v.Aux)
4340 if y.Op != Op386ADDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4345 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4348 v.reset(Op386ADDLmodify)
4349 v.AuxInt = int32ToAuxInt(off)
4350 v.Aux = symToAux(sym)
4351 v.AddArg3(ptr, x, mem)
4354 // match: (MOVLstore {sym} [off] ptr y:(ANDLload x [off] {sym} ptr mem) mem)
4355 // cond: y.Uses==1 && clobber(y)
4356 // result: (ANDLmodify [off] {sym} ptr x mem)
4358 off := auxIntToInt32(v.AuxInt)
4359 sym := auxToSym(v.Aux)
4362 if y.Op != Op386ANDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4367 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4370 v.reset(Op386ANDLmodify)
4371 v.AuxInt = int32ToAuxInt(off)
4372 v.Aux = symToAux(sym)
4373 v.AddArg3(ptr, x, mem)
4376 // match: (MOVLstore {sym} [off] ptr y:(ORLload x [off] {sym} ptr mem) mem)
4377 // cond: y.Uses==1 && clobber(y)
4378 // result: (ORLmodify [off] {sym} ptr x mem)
4380 off := auxIntToInt32(v.AuxInt)
4381 sym := auxToSym(v.Aux)
4384 if y.Op != Op386ORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4389 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4392 v.reset(Op386ORLmodify)
4393 v.AuxInt = int32ToAuxInt(off)
4394 v.Aux = symToAux(sym)
4395 v.AddArg3(ptr, x, mem)
4398 // match: (MOVLstore {sym} [off] ptr y:(XORLload x [off] {sym} ptr mem) mem)
4399 // cond: y.Uses==1 && clobber(y)
4400 // result: (XORLmodify [off] {sym} ptr x mem)
4402 off := auxIntToInt32(v.AuxInt)
4403 sym := auxToSym(v.Aux)
4406 if y.Op != Op386XORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4411 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4414 v.reset(Op386XORLmodify)
4415 v.AuxInt = int32ToAuxInt(off)
4416 v.Aux = symToAux(sym)
4417 v.AddArg3(ptr, x, mem)
4420 // match: (MOVLstore {sym} [off] ptr y:(ADDL l:(MOVLload [off] {sym} ptr mem) x) mem)
4421 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4422 // result: (ADDLmodify [off] {sym} ptr x mem)
4424 off := auxIntToInt32(v.AuxInt)
4425 sym := auxToSym(v.Aux)
4428 if y.Op != Op386ADDL {
4434 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4436 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4440 if ptr != l.Args[0] {
4444 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4447 v.reset(Op386ADDLmodify)
4448 v.AuxInt = int32ToAuxInt(off)
4449 v.Aux = symToAux(sym)
4450 v.AddArg3(ptr, x, mem)
4455 // match: (MOVLstore {sym} [off] ptr y:(SUBL l:(MOVLload [off] {sym} ptr mem) x) mem)
4456 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4457 // result: (SUBLmodify [off] {sym} ptr x mem)
4459 off := auxIntToInt32(v.AuxInt)
4460 sym := auxToSym(v.Aux)
4463 if y.Op != Op386SUBL {
4468 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4472 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4475 v.reset(Op386SUBLmodify)
4476 v.AuxInt = int32ToAuxInt(off)
4477 v.Aux = symToAux(sym)
4478 v.AddArg3(ptr, x, mem)
4481 // match: (MOVLstore {sym} [off] ptr y:(ANDL l:(MOVLload [off] {sym} ptr mem) x) mem)
4482 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4483 // result: (ANDLmodify [off] {sym} ptr x mem)
4485 off := auxIntToInt32(v.AuxInt)
4486 sym := auxToSym(v.Aux)
4489 if y.Op != Op386ANDL {
4495 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4497 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4501 if ptr != l.Args[0] {
4505 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4508 v.reset(Op386ANDLmodify)
4509 v.AuxInt = int32ToAuxInt(off)
4510 v.Aux = symToAux(sym)
4511 v.AddArg3(ptr, x, mem)
4516 // match: (MOVLstore {sym} [off] ptr y:(ORL l:(MOVLload [off] {sym} ptr mem) x) mem)
4517 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4518 // result: (ORLmodify [off] {sym} ptr x mem)
4520 off := auxIntToInt32(v.AuxInt)
4521 sym := auxToSym(v.Aux)
4524 if y.Op != Op386ORL {
4530 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4532 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4536 if ptr != l.Args[0] {
4540 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4543 v.reset(Op386ORLmodify)
4544 v.AuxInt = int32ToAuxInt(off)
4545 v.Aux = symToAux(sym)
4546 v.AddArg3(ptr, x, mem)
4551 // match: (MOVLstore {sym} [off] ptr y:(XORL l:(MOVLload [off] {sym} ptr mem) x) mem)
4552 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4553 // result: (XORLmodify [off] {sym} ptr x mem)
4555 off := auxIntToInt32(v.AuxInt)
4556 sym := auxToSym(v.Aux)
4559 if y.Op != Op386XORL {
4565 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4567 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4571 if ptr != l.Args[0] {
4575 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4578 v.reset(Op386XORLmodify)
4579 v.AuxInt = int32ToAuxInt(off)
4580 v.Aux = symToAux(sym)
4581 v.AddArg3(ptr, x, mem)
4586 // match: (MOVLstore {sym} [off] ptr y:(ADDLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4587 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4588 // result: (ADDLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4590 off := auxIntToInt32(v.AuxInt)
4591 sym := auxToSym(v.Aux)
4594 if y.Op != Op386ADDLconst {
4597 c := auxIntToInt32(y.AuxInt)
4599 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4603 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4606 v.reset(Op386ADDLconstmodify)
4607 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4608 v.Aux = symToAux(sym)
4612 // match: (MOVLstore {sym} [off] ptr y:(ANDLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4613 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4614 // result: (ANDLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4616 off := auxIntToInt32(v.AuxInt)
4617 sym := auxToSym(v.Aux)
4620 if y.Op != Op386ANDLconst {
4623 c := auxIntToInt32(y.AuxInt)
4625 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4629 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4632 v.reset(Op386ANDLconstmodify)
4633 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4634 v.Aux = symToAux(sym)
4638 // match: (MOVLstore {sym} [off] ptr y:(ORLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4639 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4640 // result: (ORLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4642 off := auxIntToInt32(v.AuxInt)
4643 sym := auxToSym(v.Aux)
4646 if y.Op != Op386ORLconst {
4649 c := auxIntToInt32(y.AuxInt)
4651 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4655 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4658 v.reset(Op386ORLconstmodify)
4659 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4660 v.Aux = symToAux(sym)
4664 // match: (MOVLstore {sym} [off] ptr y:(XORLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4665 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4666 // result: (XORLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4668 off := auxIntToInt32(v.AuxInt)
4669 sym := auxToSym(v.Aux)
4672 if y.Op != Op386XORLconst {
4675 c := auxIntToInt32(y.AuxInt)
4677 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4681 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4684 v.reset(Op386XORLconstmodify)
4685 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4686 v.Aux = symToAux(sym)
4692 func rewriteValue386_Op386MOVLstoreconst(v *Value) bool {
4696 config := b.Func.Config
4697 // match: (MOVLstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
4698 // cond: sc.canAdd32(off)
4699 // result: (MOVLstoreconst [sc.addOffset32(off)] {s} ptr mem)
4701 sc := auxIntToValAndOff(v.AuxInt)
4702 s := auxToSym(v.Aux)
4703 if v_0.Op != Op386ADDLconst {
4706 off := auxIntToInt32(v_0.AuxInt)
4709 if !(sc.canAdd32(off)) {
4712 v.reset(Op386MOVLstoreconst)
4713 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4718 // match: (MOVLstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
4719 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4720 // result: (MOVLstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
4722 sc := auxIntToValAndOff(v.AuxInt)
4723 sym1 := auxToSym(v.Aux)
4724 if v_0.Op != Op386LEAL {
4727 off := auxIntToInt32(v_0.AuxInt)
4728 sym2 := auxToSym(v_0.Aux)
4731 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4734 v.reset(Op386MOVLstoreconst)
4735 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4736 v.Aux = symToAux(mergeSym(sym1, sym2))
4742 func rewriteValue386_Op386MOVSDconst(v *Value) bool {
4744 config := b.Func.Config
4745 typ := &b.Func.Config.Types
4746 // match: (MOVSDconst [c])
4747 // cond: config.ctxt.Flag_shared
4748 // result: (MOVSDconst2 (MOVSDconst1 [c]))
4750 c := auxIntToFloat64(v.AuxInt)
4751 if !(config.ctxt.Flag_shared) {
4754 v.reset(Op386MOVSDconst2)
4755 v0 := b.NewValue0(v.Pos, Op386MOVSDconst1, typ.UInt32)
4756 v0.AuxInt = float64ToAuxInt(c)
4762 func rewriteValue386_Op386MOVSDload(v *Value) bool {
4766 config := b.Func.Config
4767 // match: (MOVSDload [off1] {sym} (ADDLconst [off2] ptr) mem)
4768 // cond: is32Bit(int64(off1)+int64(off2))
4769 // result: (MOVSDload [off1+off2] {sym} ptr mem)
4771 off1 := auxIntToInt32(v.AuxInt)
4772 sym := auxToSym(v.Aux)
4773 if v_0.Op != Op386ADDLconst {
4776 off2 := auxIntToInt32(v_0.AuxInt)
4779 if !(is32Bit(int64(off1) + int64(off2))) {
4782 v.reset(Op386MOVSDload)
4783 v.AuxInt = int32ToAuxInt(off1 + off2)
4784 v.Aux = symToAux(sym)
4788 // match: (MOVSDload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4789 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4790 // result: (MOVSDload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4792 off1 := auxIntToInt32(v.AuxInt)
4793 sym1 := auxToSym(v.Aux)
4794 if v_0.Op != Op386LEAL {
4797 off2 := auxIntToInt32(v_0.AuxInt)
4798 sym2 := auxToSym(v_0.Aux)
4801 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4804 v.reset(Op386MOVSDload)
4805 v.AuxInt = int32ToAuxInt(off1 + off2)
4806 v.Aux = symToAux(mergeSym(sym1, sym2))
4807 v.AddArg2(base, mem)
4812 func rewriteValue386_Op386MOVSDstore(v *Value) bool {
4817 config := b.Func.Config
4818 // match: (MOVSDstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4819 // cond: is32Bit(int64(off1)+int64(off2))
4820 // result: (MOVSDstore [off1+off2] {sym} ptr val mem)
4822 off1 := auxIntToInt32(v.AuxInt)
4823 sym := auxToSym(v.Aux)
4824 if v_0.Op != Op386ADDLconst {
4827 off2 := auxIntToInt32(v_0.AuxInt)
4831 if !(is32Bit(int64(off1) + int64(off2))) {
4834 v.reset(Op386MOVSDstore)
4835 v.AuxInt = int32ToAuxInt(off1 + off2)
4836 v.Aux = symToAux(sym)
4837 v.AddArg3(ptr, val, mem)
4840 // match: (MOVSDstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4841 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4842 // result: (MOVSDstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4844 off1 := auxIntToInt32(v.AuxInt)
4845 sym1 := auxToSym(v.Aux)
4846 if v_0.Op != Op386LEAL {
4849 off2 := auxIntToInt32(v_0.AuxInt)
4850 sym2 := auxToSym(v_0.Aux)
4854 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4857 v.reset(Op386MOVSDstore)
4858 v.AuxInt = int32ToAuxInt(off1 + off2)
4859 v.Aux = symToAux(mergeSym(sym1, sym2))
4860 v.AddArg3(base, val, mem)
4865 func rewriteValue386_Op386MOVSSconst(v *Value) bool {
4867 config := b.Func.Config
4868 typ := &b.Func.Config.Types
4869 // match: (MOVSSconst [c])
4870 // cond: config.ctxt.Flag_shared
4871 // result: (MOVSSconst2 (MOVSSconst1 [c]))
4873 c := auxIntToFloat32(v.AuxInt)
4874 if !(config.ctxt.Flag_shared) {
4877 v.reset(Op386MOVSSconst2)
4878 v0 := b.NewValue0(v.Pos, Op386MOVSSconst1, typ.UInt32)
4879 v0.AuxInt = float32ToAuxInt(c)
4885 func rewriteValue386_Op386MOVSSload(v *Value) bool {
4889 config := b.Func.Config
4890 // match: (MOVSSload [off1] {sym} (ADDLconst [off2] ptr) mem)
4891 // cond: is32Bit(int64(off1)+int64(off2))
4892 // result: (MOVSSload [off1+off2] {sym} ptr mem)
4894 off1 := auxIntToInt32(v.AuxInt)
4895 sym := auxToSym(v.Aux)
4896 if v_0.Op != Op386ADDLconst {
4899 off2 := auxIntToInt32(v_0.AuxInt)
4902 if !(is32Bit(int64(off1) + int64(off2))) {
4905 v.reset(Op386MOVSSload)
4906 v.AuxInt = int32ToAuxInt(off1 + off2)
4907 v.Aux = symToAux(sym)
4911 // match: (MOVSSload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4912 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4913 // result: (MOVSSload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4915 off1 := auxIntToInt32(v.AuxInt)
4916 sym1 := auxToSym(v.Aux)
4917 if v_0.Op != Op386LEAL {
4920 off2 := auxIntToInt32(v_0.AuxInt)
4921 sym2 := auxToSym(v_0.Aux)
4924 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4927 v.reset(Op386MOVSSload)
4928 v.AuxInt = int32ToAuxInt(off1 + off2)
4929 v.Aux = symToAux(mergeSym(sym1, sym2))
4930 v.AddArg2(base, mem)
4935 func rewriteValue386_Op386MOVSSstore(v *Value) bool {
4940 config := b.Func.Config
4941 // match: (MOVSSstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4942 // cond: is32Bit(int64(off1)+int64(off2))
4943 // result: (MOVSSstore [off1+off2] {sym} ptr val mem)
4945 off1 := auxIntToInt32(v.AuxInt)
4946 sym := auxToSym(v.Aux)
4947 if v_0.Op != Op386ADDLconst {
4950 off2 := auxIntToInt32(v_0.AuxInt)
4954 if !(is32Bit(int64(off1) + int64(off2))) {
4957 v.reset(Op386MOVSSstore)
4958 v.AuxInt = int32ToAuxInt(off1 + off2)
4959 v.Aux = symToAux(sym)
4960 v.AddArg3(ptr, val, mem)
4963 // match: (MOVSSstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4964 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4965 // result: (MOVSSstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4967 off1 := auxIntToInt32(v.AuxInt)
4968 sym1 := auxToSym(v.Aux)
4969 if v_0.Op != Op386LEAL {
4972 off2 := auxIntToInt32(v_0.AuxInt)
4973 sym2 := auxToSym(v_0.Aux)
4977 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4980 v.reset(Op386MOVSSstore)
4981 v.AuxInt = int32ToAuxInt(off1 + off2)
4982 v.Aux = symToAux(mergeSym(sym1, sym2))
4983 v.AddArg3(base, val, mem)
4988 func rewriteValue386_Op386MOVWLSX(v *Value) bool {
4991 // match: (MOVWLSX x:(MOVWload [off] {sym} ptr mem))
4992 // cond: x.Uses == 1 && clobber(x)
4993 // result: @x.Block (MOVWLSXload <v.Type> [off] {sym} ptr mem)
4996 if x.Op != Op386MOVWload {
4999 off := auxIntToInt32(x.AuxInt)
5000 sym := auxToSym(x.Aux)
5003 if !(x.Uses == 1 && clobber(x)) {
5007 v0 := b.NewValue0(x.Pos, Op386MOVWLSXload, v.Type)
5009 v0.AuxInt = int32ToAuxInt(off)
5010 v0.Aux = symToAux(sym)
5011 v0.AddArg2(ptr, mem)
5014 // match: (MOVWLSX (ANDLconst [c] x))
5015 // cond: c & 0x8000 == 0
5016 // result: (ANDLconst [c & 0x7fff] x)
5018 if v_0.Op != Op386ANDLconst {
5021 c := auxIntToInt32(v_0.AuxInt)
5023 if !(c&0x8000 == 0) {
5026 v.reset(Op386ANDLconst)
5027 v.AuxInt = int32ToAuxInt(c & 0x7fff)
5033 func rewriteValue386_Op386MOVWLSXload(v *Value) bool {
5037 config := b.Func.Config
5038 // match: (MOVWLSXload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _))
5039 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
5040 // result: (MOVWLSX x)
5042 off := auxIntToInt32(v.AuxInt)
5043 sym := auxToSym(v.Aux)
5045 if v_1.Op != Op386MOVWstore {
5048 off2 := auxIntToInt32(v_1.AuxInt)
5049 sym2 := auxToSym(v_1.Aux)
5052 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
5055 v.reset(Op386MOVWLSX)
5059 // match: (MOVWLSXload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
5060 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5061 // result: (MOVWLSXload [off1+off2] {mergeSym(sym1,sym2)} base mem)
5063 off1 := auxIntToInt32(v.AuxInt)
5064 sym1 := auxToSym(v.Aux)
5065 if v_0.Op != Op386LEAL {
5068 off2 := auxIntToInt32(v_0.AuxInt)
5069 sym2 := auxToSym(v_0.Aux)
5072 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5075 v.reset(Op386MOVWLSXload)
5076 v.AuxInt = int32ToAuxInt(off1 + off2)
5077 v.Aux = symToAux(mergeSym(sym1, sym2))
5078 v.AddArg2(base, mem)
5083 func rewriteValue386_Op386MOVWLZX(v *Value) bool {
5086 // match: (MOVWLZX x:(MOVWload [off] {sym} ptr mem))
5087 // cond: x.Uses == 1 && clobber(x)
5088 // result: @x.Block (MOVWload <v.Type> [off] {sym} ptr mem)
5091 if x.Op != Op386MOVWload {
5094 off := auxIntToInt32(x.AuxInt)
5095 sym := auxToSym(x.Aux)
5098 if !(x.Uses == 1 && clobber(x)) {
5102 v0 := b.NewValue0(x.Pos, Op386MOVWload, v.Type)
5104 v0.AuxInt = int32ToAuxInt(off)
5105 v0.Aux = symToAux(sym)
5106 v0.AddArg2(ptr, mem)
5109 // match: (MOVWLZX (ANDLconst [c] x))
5110 // result: (ANDLconst [c & 0xffff] x)
5112 if v_0.Op != Op386ANDLconst {
5115 c := auxIntToInt32(v_0.AuxInt)
5117 v.reset(Op386ANDLconst)
5118 v.AuxInt = int32ToAuxInt(c & 0xffff)
5124 func rewriteValue386_Op386MOVWload(v *Value) bool {
5128 config := b.Func.Config
5129 // match: (MOVWload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _))
5130 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
5131 // result: (MOVWLZX x)
5133 off := auxIntToInt32(v.AuxInt)
5134 sym := auxToSym(v.Aux)
5136 if v_1.Op != Op386MOVWstore {
5139 off2 := auxIntToInt32(v_1.AuxInt)
5140 sym2 := auxToSym(v_1.Aux)
5143 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
5146 v.reset(Op386MOVWLZX)
5150 // match: (MOVWload [off1] {sym} (ADDLconst [off2] ptr) mem)
5151 // cond: is32Bit(int64(off1)+int64(off2))
5152 // result: (MOVWload [off1+off2] {sym} ptr mem)
5154 off1 := auxIntToInt32(v.AuxInt)
5155 sym := auxToSym(v.Aux)
5156 if v_0.Op != Op386ADDLconst {
5159 off2 := auxIntToInt32(v_0.AuxInt)
5162 if !(is32Bit(int64(off1) + int64(off2))) {
5165 v.reset(Op386MOVWload)
5166 v.AuxInt = int32ToAuxInt(off1 + off2)
5167 v.Aux = symToAux(sym)
5171 // match: (MOVWload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
5172 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5173 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} base mem)
5175 off1 := auxIntToInt32(v.AuxInt)
5176 sym1 := auxToSym(v.Aux)
5177 if v_0.Op != Op386LEAL {
5180 off2 := auxIntToInt32(v_0.AuxInt)
5181 sym2 := auxToSym(v_0.Aux)
5184 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5187 v.reset(Op386MOVWload)
5188 v.AuxInt = int32ToAuxInt(off1 + off2)
5189 v.Aux = symToAux(mergeSym(sym1, sym2))
5190 v.AddArg2(base, mem)
5193 // match: (MOVWload [off] {sym} (SB) _)
5194 // cond: symIsRO(sym)
5195 // result: (MOVLconst [int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
5197 off := auxIntToInt32(v.AuxInt)
5198 sym := auxToSym(v.Aux)
5199 if v_0.Op != OpSB || !(symIsRO(sym)) {
5202 v.reset(Op386MOVLconst)
5203 v.AuxInt = int32ToAuxInt(int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
5208 func rewriteValue386_Op386MOVWstore(v *Value) bool {
5213 config := b.Func.Config
5214 // match: (MOVWstore [off] {sym} ptr (MOVWLSX x) mem)
5215 // result: (MOVWstore [off] {sym} ptr x mem)
5217 off := auxIntToInt32(v.AuxInt)
5218 sym := auxToSym(v.Aux)
5220 if v_1.Op != Op386MOVWLSX {
5225 v.reset(Op386MOVWstore)
5226 v.AuxInt = int32ToAuxInt(off)
5227 v.Aux = symToAux(sym)
5228 v.AddArg3(ptr, x, mem)
5231 // match: (MOVWstore [off] {sym} ptr (MOVWLZX x) mem)
5232 // result: (MOVWstore [off] {sym} ptr x mem)
5234 off := auxIntToInt32(v.AuxInt)
5235 sym := auxToSym(v.Aux)
5237 if v_1.Op != Op386MOVWLZX {
5242 v.reset(Op386MOVWstore)
5243 v.AuxInt = int32ToAuxInt(off)
5244 v.Aux = symToAux(sym)
5245 v.AddArg3(ptr, x, mem)
5248 // match: (MOVWstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
5249 // cond: is32Bit(int64(off1)+int64(off2))
5250 // result: (MOVWstore [off1+off2] {sym} ptr val mem)
5252 off1 := auxIntToInt32(v.AuxInt)
5253 sym := auxToSym(v.Aux)
5254 if v_0.Op != Op386ADDLconst {
5257 off2 := auxIntToInt32(v_0.AuxInt)
5261 if !(is32Bit(int64(off1) + int64(off2))) {
5264 v.reset(Op386MOVWstore)
5265 v.AuxInt = int32ToAuxInt(off1 + off2)
5266 v.Aux = symToAux(sym)
5267 v.AddArg3(ptr, val, mem)
5270 // match: (MOVWstore [off] {sym} ptr (MOVLconst [c]) mem)
5271 // result: (MOVWstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
5273 off := auxIntToInt32(v.AuxInt)
5274 sym := auxToSym(v.Aux)
5276 if v_1.Op != Op386MOVLconst {
5279 c := auxIntToInt32(v_1.AuxInt)
5281 v.reset(Op386MOVWstoreconst)
5282 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
5283 v.Aux = symToAux(sym)
5287 // match: (MOVWstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
5288 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5289 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
5291 off1 := auxIntToInt32(v.AuxInt)
5292 sym1 := auxToSym(v.Aux)
5293 if v_0.Op != Op386LEAL {
5296 off2 := auxIntToInt32(v_0.AuxInt)
5297 sym2 := auxToSym(v_0.Aux)
5301 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5304 v.reset(Op386MOVWstore)
5305 v.AuxInt = int32ToAuxInt(off1 + off2)
5306 v.Aux = symToAux(mergeSym(sym1, sym2))
5307 v.AddArg3(base, val, mem)
5310 // match: (MOVWstore [i] {s} p (SHRLconst [16] w) x:(MOVWstore [i-2] {s} p w mem))
5311 // cond: x.Uses == 1 && clobber(x)
5312 // result: (MOVLstore [i-2] {s} p w mem)
5314 i := auxIntToInt32(v.AuxInt)
5315 s := auxToSym(v.Aux)
5317 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
5322 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
5326 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
5329 v.reset(Op386MOVLstore)
5330 v.AuxInt = int32ToAuxInt(i - 2)
5332 v.AddArg3(p, w, mem)
5335 // match: (MOVWstore [i] {s} p (SHRLconst [j] w) x:(MOVWstore [i-2] {s} p w0:(SHRLconst [j-16] w) mem))
5336 // cond: x.Uses == 1 && clobber(x)
5337 // result: (MOVLstore [i-2] {s} p w0 mem)
5339 i := auxIntToInt32(v.AuxInt)
5340 s := auxToSym(v.Aux)
5342 if v_1.Op != Op386SHRLconst {
5345 j := auxIntToInt32(v_1.AuxInt)
5348 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
5356 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
5359 v.reset(Op386MOVLstore)
5360 v.AuxInt = int32ToAuxInt(i - 2)
5362 v.AddArg3(p, w0, mem)
5365 // match: (MOVWstore [i] {s} p1 (SHRLconst [16] w) x:(MOVWstore [i] {s} p0 w mem))
5366 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
5367 // result: (MOVLstore [i] {s} p0 w mem)
5369 i := auxIntToInt32(v.AuxInt)
5370 s := auxToSym(v.Aux)
5372 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
5377 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
5382 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5385 v.reset(Op386MOVLstore)
5386 v.AuxInt = int32ToAuxInt(i)
5388 v.AddArg3(p0, w, mem)
5391 // match: (MOVWstore [i] {s} p1 (SHRLconst [j] w) x:(MOVWstore [i] {s} p0 w0:(SHRLconst [j-16] w) mem))
5392 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
5393 // result: (MOVLstore [i] {s} p0 w0 mem)
5395 i := auxIntToInt32(v.AuxInt)
5396 s := auxToSym(v.Aux)
5398 if v_1.Op != Op386SHRLconst {
5401 j := auxIntToInt32(v_1.AuxInt)
5404 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
5410 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5413 v.reset(Op386MOVLstore)
5414 v.AuxInt = int32ToAuxInt(i)
5416 v.AddArg3(p0, w0, mem)
5421 func rewriteValue386_Op386MOVWstoreconst(v *Value) bool {
5425 config := b.Func.Config
5426 // match: (MOVWstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
5427 // cond: sc.canAdd32(off)
5428 // result: (MOVWstoreconst [sc.addOffset32(off)] {s} ptr mem)
5430 sc := auxIntToValAndOff(v.AuxInt)
5431 s := auxToSym(v.Aux)
5432 if v_0.Op != Op386ADDLconst {
5435 off := auxIntToInt32(v_0.AuxInt)
5438 if !(sc.canAdd32(off)) {
5441 v.reset(Op386MOVWstoreconst)
5442 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
5447 // match: (MOVWstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
5448 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
5449 // result: (MOVWstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
5451 sc := auxIntToValAndOff(v.AuxInt)
5452 sym1 := auxToSym(v.Aux)
5453 if v_0.Op != Op386LEAL {
5456 off := auxIntToInt32(v_0.AuxInt)
5457 sym2 := auxToSym(v_0.Aux)
5460 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
5463 v.reset(Op386MOVWstoreconst)
5464 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
5465 v.Aux = symToAux(mergeSym(sym1, sym2))
5469 // match: (MOVWstoreconst [c] {s} p x:(MOVWstoreconst [a] {s} p mem))
5470 // cond: x.Uses == 1 && a.Off() + 2 == c.Off() && clobber(x)
5471 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p mem)
5473 c := auxIntToValAndOff(v.AuxInt)
5474 s := auxToSym(v.Aux)
5477 if x.Op != Op386MOVWstoreconst {
5480 a := auxIntToValAndOff(x.AuxInt)
5481 if auxToSym(x.Aux) != s {
5485 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+2 == c.Off() && clobber(x)) {
5488 v.reset(Op386MOVLstoreconst)
5489 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5494 // match: (MOVWstoreconst [a] {s} p x:(MOVWstoreconst [c] {s} p mem))
5495 // cond: x.Uses == 1 && ValAndOff(a).Off() + 2 == ValAndOff(c).Off() && clobber(x)
5496 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p mem)
5498 a := auxIntToValAndOff(v.AuxInt)
5499 s := auxToSym(v.Aux)
5502 if x.Op != Op386MOVWstoreconst {
5505 c := auxIntToValAndOff(x.AuxInt)
5506 if auxToSym(x.Aux) != s {
5510 if p != x.Args[0] || !(x.Uses == 1 && ValAndOff(a).Off()+2 == ValAndOff(c).Off() && clobber(x)) {
5513 v.reset(Op386MOVLstoreconst)
5514 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5519 // match: (MOVWstoreconst [c] {s} p1 x:(MOVWstoreconst [a] {s} p0 mem))
5520 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
5521 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p0 mem)
5523 c := auxIntToValAndOff(v.AuxInt)
5524 s := auxToSym(v.Aux)
5527 if x.Op != Op386MOVWstoreconst {
5530 a := auxIntToValAndOff(x.AuxInt)
5531 if auxToSym(x.Aux) != s {
5536 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5539 v.reset(Op386MOVLstoreconst)
5540 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5545 // match: (MOVWstoreconst [a] {s} p0 x:(MOVWstoreconst [c] {s} p1 mem))
5546 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
5547 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p0 mem)
5549 a := auxIntToValAndOff(v.AuxInt)
5550 s := auxToSym(v.Aux)
5553 if x.Op != Op386MOVWstoreconst {
5556 c := auxIntToValAndOff(x.AuxInt)
5557 if auxToSym(x.Aux) != s {
5562 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5565 v.reset(Op386MOVLstoreconst)
5566 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5573 func rewriteValue386_Op386MULL(v *Value) bool {
5576 // match: (MULL x (MOVLconst [c]))
5577 // result: (MULLconst [c] x)
5579 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5581 if v_1.Op != Op386MOVLconst {
5584 c := auxIntToInt32(v_1.AuxInt)
5585 v.reset(Op386MULLconst)
5586 v.AuxInt = int32ToAuxInt(c)
5592 // match: (MULL x l:(MOVLload [off] {sym} ptr mem))
5593 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
5594 // result: (MULLload x [off] {sym} ptr mem)
5596 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5599 if l.Op != Op386MOVLload {
5602 off := auxIntToInt32(l.AuxInt)
5603 sym := auxToSym(l.Aux)
5606 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5609 v.reset(Op386MULLload)
5610 v.AuxInt = int32ToAuxInt(off)
5611 v.Aux = symToAux(sym)
5612 v.AddArg3(x, ptr, mem)
5619 func rewriteValue386_Op386MULLconst(v *Value) bool {
5622 // match: (MULLconst [c] (MULLconst [d] x))
5623 // result: (MULLconst [c * d] x)
5625 c := auxIntToInt32(v.AuxInt)
5626 if v_0.Op != Op386MULLconst {
5629 d := auxIntToInt32(v_0.AuxInt)
5631 v.reset(Op386MULLconst)
5632 v.AuxInt = int32ToAuxInt(c * d)
5636 // match: (MULLconst [-9] x)
5637 // result: (NEGL (LEAL8 <v.Type> x x))
5639 if auxIntToInt32(v.AuxInt) != -9 {
5644 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5649 // match: (MULLconst [-5] x)
5650 // result: (NEGL (LEAL4 <v.Type> x x))
5652 if auxIntToInt32(v.AuxInt) != -5 {
5657 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5662 // match: (MULLconst [-3] x)
5663 // result: (NEGL (LEAL2 <v.Type> x x))
5665 if auxIntToInt32(v.AuxInt) != -3 {
5670 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5675 // match: (MULLconst [-1] x)
5678 if auxIntToInt32(v.AuxInt) != -1 {
5686 // match: (MULLconst [0] _)
5687 // result: (MOVLconst [0])
5689 if auxIntToInt32(v.AuxInt) != 0 {
5692 v.reset(Op386MOVLconst)
5693 v.AuxInt = int32ToAuxInt(0)
5696 // match: (MULLconst [1] x)
5699 if auxIntToInt32(v.AuxInt) != 1 {
5706 // match: (MULLconst [3] x)
5707 // result: (LEAL2 x x)
5709 if auxIntToInt32(v.AuxInt) != 3 {
5717 // match: (MULLconst [5] x)
5718 // result: (LEAL4 x x)
5720 if auxIntToInt32(v.AuxInt) != 5 {
5728 // match: (MULLconst [7] x)
5729 // result: (LEAL2 x (LEAL2 <v.Type> x x))
5731 if auxIntToInt32(v.AuxInt) != 7 {
5736 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5741 // match: (MULLconst [9] x)
5742 // result: (LEAL8 x x)
5744 if auxIntToInt32(v.AuxInt) != 9 {
5752 // match: (MULLconst [11] x)
5753 // result: (LEAL2 x (LEAL4 <v.Type> x x))
5755 if auxIntToInt32(v.AuxInt) != 11 {
5760 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5765 // match: (MULLconst [13] x)
5766 // result: (LEAL4 x (LEAL2 <v.Type> x x))
5768 if auxIntToInt32(v.AuxInt) != 13 {
5773 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5778 // match: (MULLconst [19] x)
5779 // result: (LEAL2 x (LEAL8 <v.Type> x x))
5781 if auxIntToInt32(v.AuxInt) != 19 {
5786 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5791 // match: (MULLconst [21] x)
5792 // result: (LEAL4 x (LEAL4 <v.Type> x x))
5794 if auxIntToInt32(v.AuxInt) != 21 {
5799 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5804 // match: (MULLconst [25] x)
5805 // result: (LEAL8 x (LEAL2 <v.Type> x x))
5807 if auxIntToInt32(v.AuxInt) != 25 {
5812 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5817 // match: (MULLconst [27] x)
5818 // result: (LEAL8 (LEAL2 <v.Type> x x) (LEAL2 <v.Type> x x))
5820 if auxIntToInt32(v.AuxInt) != 27 {
5825 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5830 // match: (MULLconst [37] x)
5831 // result: (LEAL4 x (LEAL8 <v.Type> x x))
5833 if auxIntToInt32(v.AuxInt) != 37 {
5838 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5843 // match: (MULLconst [41] x)
5844 // result: (LEAL8 x (LEAL4 <v.Type> x x))
5846 if auxIntToInt32(v.AuxInt) != 41 {
5851 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5856 // match: (MULLconst [45] x)
5857 // result: (LEAL8 (LEAL4 <v.Type> x x) (LEAL4 <v.Type> x x))
5859 if auxIntToInt32(v.AuxInt) != 45 {
5864 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5869 // match: (MULLconst [73] x)
5870 // result: (LEAL8 x (LEAL8 <v.Type> x x))
5872 if auxIntToInt32(v.AuxInt) != 73 {
5877 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5882 // match: (MULLconst [81] x)
5883 // result: (LEAL8 (LEAL8 <v.Type> x x) (LEAL8 <v.Type> x x))
5885 if auxIntToInt32(v.AuxInt) != 81 {
5890 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5895 // match: (MULLconst [c] x)
5896 // cond: isPowerOfTwo32(c+1) && c >= 15
5897 // result: (SUBL (SHLLconst <v.Type> [int32(log32(c+1))] x) x)
5899 c := auxIntToInt32(v.AuxInt)
5901 if !(isPowerOfTwo32(c+1) && c >= 15) {
5905 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5906 v0.AuxInt = int32ToAuxInt(int32(log32(c + 1)))
5911 // match: (MULLconst [c] x)
5912 // cond: isPowerOfTwo32(c-1) && c >= 17
5913 // result: (LEAL1 (SHLLconst <v.Type> [int32(log32(c-1))] x) x)
5915 c := auxIntToInt32(v.AuxInt)
5917 if !(isPowerOfTwo32(c-1) && c >= 17) {
5921 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5922 v0.AuxInt = int32ToAuxInt(int32(log32(c - 1)))
5927 // match: (MULLconst [c] x)
5928 // cond: isPowerOfTwo32(c-2) && c >= 34
5929 // result: (LEAL2 (SHLLconst <v.Type> [int32(log32(c-2))] x) x)
5931 c := auxIntToInt32(v.AuxInt)
5933 if !(isPowerOfTwo32(c-2) && c >= 34) {
5937 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5938 v0.AuxInt = int32ToAuxInt(int32(log32(c - 2)))
5943 // match: (MULLconst [c] x)
5944 // cond: isPowerOfTwo32(c-4) && c >= 68
5945 // result: (LEAL4 (SHLLconst <v.Type> [int32(log32(c-4))] x) x)
5947 c := auxIntToInt32(v.AuxInt)
5949 if !(isPowerOfTwo32(c-4) && c >= 68) {
5953 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5954 v0.AuxInt = int32ToAuxInt(int32(log32(c - 4)))
5959 // match: (MULLconst [c] x)
5960 // cond: isPowerOfTwo32(c-8) && c >= 136
5961 // result: (LEAL8 (SHLLconst <v.Type> [int32(log32(c-8))] x) x)
5963 c := auxIntToInt32(v.AuxInt)
5965 if !(isPowerOfTwo32(c-8) && c >= 136) {
5969 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5970 v0.AuxInt = int32ToAuxInt(int32(log32(c - 8)))
5975 // match: (MULLconst [c] x)
5976 // cond: c%3 == 0 && isPowerOfTwo32(c/3)
5977 // result: (SHLLconst [int32(log32(c/3))] (LEAL2 <v.Type> x x))
5979 c := auxIntToInt32(v.AuxInt)
5981 if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
5984 v.reset(Op386SHLLconst)
5985 v.AuxInt = int32ToAuxInt(int32(log32(c / 3)))
5986 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5991 // match: (MULLconst [c] x)
5992 // cond: c%5 == 0 && isPowerOfTwo32(c/5)
5993 // result: (SHLLconst [int32(log32(c/5))] (LEAL4 <v.Type> x x))
5995 c := auxIntToInt32(v.AuxInt)
5997 if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
6000 v.reset(Op386SHLLconst)
6001 v.AuxInt = int32ToAuxInt(int32(log32(c / 5)))
6002 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
6007 // match: (MULLconst [c] x)
6008 // cond: c%9 == 0 && isPowerOfTwo32(c/9)
6009 // result: (SHLLconst [int32(log32(c/9))] (LEAL8 <v.Type> x x))
6011 c := auxIntToInt32(v.AuxInt)
6013 if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
6016 v.reset(Op386SHLLconst)
6017 v.AuxInt = int32ToAuxInt(int32(log32(c / 9)))
6018 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
6023 // match: (MULLconst [c] (MOVLconst [d]))
6024 // result: (MOVLconst [c*d])
6026 c := auxIntToInt32(v.AuxInt)
6027 if v_0.Op != Op386MOVLconst {
6030 d := auxIntToInt32(v_0.AuxInt)
6031 v.reset(Op386MOVLconst)
6032 v.AuxInt = int32ToAuxInt(c * d)
6037 func rewriteValue386_Op386MULLload(v *Value) bool {
6042 config := b.Func.Config
6043 // match: (MULLload [off1] {sym} val (ADDLconst [off2] base) mem)
6044 // cond: is32Bit(int64(off1)+int64(off2))
6045 // result: (MULLload [off1+off2] {sym} val base mem)
6047 off1 := auxIntToInt32(v.AuxInt)
6048 sym := auxToSym(v.Aux)
6050 if v_1.Op != Op386ADDLconst {
6053 off2 := auxIntToInt32(v_1.AuxInt)
6056 if !(is32Bit(int64(off1) + int64(off2))) {
6059 v.reset(Op386MULLload)
6060 v.AuxInt = int32ToAuxInt(off1 + off2)
6061 v.Aux = symToAux(sym)
6062 v.AddArg3(val, base, mem)
6065 // match: (MULLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6066 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6067 // result: (MULLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6069 off1 := auxIntToInt32(v.AuxInt)
6070 sym1 := auxToSym(v.Aux)
6072 if v_1.Op != Op386LEAL {
6075 off2 := auxIntToInt32(v_1.AuxInt)
6076 sym2 := auxToSym(v_1.Aux)
6079 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6082 v.reset(Op386MULLload)
6083 v.AuxInt = int32ToAuxInt(off1 + off2)
6084 v.Aux = symToAux(mergeSym(sym1, sym2))
6085 v.AddArg3(val, base, mem)
6090 func rewriteValue386_Op386MULSD(v *Value) bool {
6093 // match: (MULSD x l:(MOVSDload [off] {sym} ptr mem))
6094 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6095 // result: (MULSDload x [off] {sym} ptr mem)
6097 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6100 if l.Op != Op386MOVSDload {
6103 off := auxIntToInt32(l.AuxInt)
6104 sym := auxToSym(l.Aux)
6107 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6110 v.reset(Op386MULSDload)
6111 v.AuxInt = int32ToAuxInt(off)
6112 v.Aux = symToAux(sym)
6113 v.AddArg3(x, ptr, mem)
6120 func rewriteValue386_Op386MULSDload(v *Value) bool {
6125 config := b.Func.Config
6126 // match: (MULSDload [off1] {sym} val (ADDLconst [off2] base) mem)
6127 // cond: is32Bit(int64(off1)+int64(off2))
6128 // result: (MULSDload [off1+off2] {sym} val base mem)
6130 off1 := auxIntToInt32(v.AuxInt)
6131 sym := auxToSym(v.Aux)
6133 if v_1.Op != Op386ADDLconst {
6136 off2 := auxIntToInt32(v_1.AuxInt)
6139 if !(is32Bit(int64(off1) + int64(off2))) {
6142 v.reset(Op386MULSDload)
6143 v.AuxInt = int32ToAuxInt(off1 + off2)
6144 v.Aux = symToAux(sym)
6145 v.AddArg3(val, base, mem)
6148 // match: (MULSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6149 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6150 // result: (MULSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6152 off1 := auxIntToInt32(v.AuxInt)
6153 sym1 := auxToSym(v.Aux)
6155 if v_1.Op != Op386LEAL {
6158 off2 := auxIntToInt32(v_1.AuxInt)
6159 sym2 := auxToSym(v_1.Aux)
6162 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6165 v.reset(Op386MULSDload)
6166 v.AuxInt = int32ToAuxInt(off1 + off2)
6167 v.Aux = symToAux(mergeSym(sym1, sym2))
6168 v.AddArg3(val, base, mem)
6173 func rewriteValue386_Op386MULSS(v *Value) bool {
6176 // match: (MULSS x l:(MOVSSload [off] {sym} ptr mem))
6177 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6178 // result: (MULSSload x [off] {sym} ptr mem)
6180 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6183 if l.Op != Op386MOVSSload {
6186 off := auxIntToInt32(l.AuxInt)
6187 sym := auxToSym(l.Aux)
6190 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6193 v.reset(Op386MULSSload)
6194 v.AuxInt = int32ToAuxInt(off)
6195 v.Aux = symToAux(sym)
6196 v.AddArg3(x, ptr, mem)
6203 func rewriteValue386_Op386MULSSload(v *Value) bool {
6208 config := b.Func.Config
6209 // match: (MULSSload [off1] {sym} val (ADDLconst [off2] base) mem)
6210 // cond: is32Bit(int64(off1)+int64(off2))
6211 // result: (MULSSload [off1+off2] {sym} val base mem)
6213 off1 := auxIntToInt32(v.AuxInt)
6214 sym := auxToSym(v.Aux)
6216 if v_1.Op != Op386ADDLconst {
6219 off2 := auxIntToInt32(v_1.AuxInt)
6222 if !(is32Bit(int64(off1) + int64(off2))) {
6225 v.reset(Op386MULSSload)
6226 v.AuxInt = int32ToAuxInt(off1 + off2)
6227 v.Aux = symToAux(sym)
6228 v.AddArg3(val, base, mem)
6231 // match: (MULSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6232 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6233 // result: (MULSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6235 off1 := auxIntToInt32(v.AuxInt)
6236 sym1 := auxToSym(v.Aux)
6238 if v_1.Op != Op386LEAL {
6241 off2 := auxIntToInt32(v_1.AuxInt)
6242 sym2 := auxToSym(v_1.Aux)
6245 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6248 v.reset(Op386MULSSload)
6249 v.AuxInt = int32ToAuxInt(off1 + off2)
6250 v.Aux = symToAux(mergeSym(sym1, sym2))
6251 v.AddArg3(val, base, mem)
6256 func rewriteValue386_Op386NEGL(v *Value) bool {
6258 // match: (NEGL (MOVLconst [c]))
6259 // result: (MOVLconst [-c])
6261 if v_0.Op != Op386MOVLconst {
6264 c := auxIntToInt32(v_0.AuxInt)
6265 v.reset(Op386MOVLconst)
6266 v.AuxInt = int32ToAuxInt(-c)
6271 func rewriteValue386_Op386NOTL(v *Value) bool {
6273 // match: (NOTL (MOVLconst [c]))
6274 // result: (MOVLconst [^c])
6276 if v_0.Op != Op386MOVLconst {
6279 c := auxIntToInt32(v_0.AuxInt)
6280 v.reset(Op386MOVLconst)
6281 v.AuxInt = int32ToAuxInt(^c)
6286 func rewriteValue386_Op386ORL(v *Value) bool {
6290 typ := &b.Func.Config.Types
6291 // match: (ORL x (MOVLconst [c]))
6292 // result: (ORLconst [c] x)
6294 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6296 if v_1.Op != Op386MOVLconst {
6299 c := auxIntToInt32(v_1.AuxInt)
6300 v.reset(Op386ORLconst)
6301 v.AuxInt = int32ToAuxInt(c)
6307 // match: ( ORL (SHLLconst [c] x) (SHRLconst [d] x))
6309 // result: (ROLLconst [c] x)
6311 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6312 if v_0.Op != Op386SHLLconst {
6315 c := auxIntToInt32(v_0.AuxInt)
6317 if v_1.Op != Op386SHRLconst {
6320 d := auxIntToInt32(v_1.AuxInt)
6321 if x != v_1.Args[0] || !(d == 32-c) {
6324 v.reset(Op386ROLLconst)
6325 v.AuxInt = int32ToAuxInt(c)
6331 // match: ( ORL <t> (SHLLconst x [c]) (SHRWconst x [d]))
6332 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
6333 // result: (ROLWconst x [int16(c)])
6336 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6337 if v_0.Op != Op386SHLLconst {
6340 c := auxIntToInt32(v_0.AuxInt)
6342 if v_1.Op != Op386SHRWconst {
6345 d := auxIntToInt16(v_1.AuxInt)
6346 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
6349 v.reset(Op386ROLWconst)
6350 v.AuxInt = int16ToAuxInt(int16(c))
6356 // match: ( ORL <t> (SHLLconst x [c]) (SHRBconst x [d]))
6357 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
6358 // result: (ROLBconst x [int8(c)])
6361 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6362 if v_0.Op != Op386SHLLconst {
6365 c := auxIntToInt32(v_0.AuxInt)
6367 if v_1.Op != Op386SHRBconst {
6370 d := auxIntToInt8(v_1.AuxInt)
6371 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
6374 v.reset(Op386ROLBconst)
6375 v.AuxInt = int8ToAuxInt(int8(c))
6381 // match: (ORL x l:(MOVLload [off] {sym} ptr mem))
6382 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6383 // result: (ORLload x [off] {sym} ptr mem)
6385 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6388 if l.Op != Op386MOVLload {
6391 off := auxIntToInt32(l.AuxInt)
6392 sym := auxToSym(l.Aux)
6395 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6398 v.reset(Op386ORLload)
6399 v.AuxInt = int32ToAuxInt(off)
6400 v.Aux = symToAux(sym)
6401 v.AddArg3(x, ptr, mem)
6416 // match: (ORL x0:(MOVBload [i0] {s} p mem) s0:(SHLLconst [8] x1:(MOVBload [i1] {s} p mem)))
6417 // cond: i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && mergePoint(b,x0,x1) != nil && clobber(x0, x1, s0)
6418 // result: @mergePoint(b,x0,x1) (MOVWload [i0] {s} p mem)
6420 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6422 if x0.Op != Op386MOVBload {
6425 i0 := auxIntToInt32(x0.AuxInt)
6426 s := auxToSym(x0.Aux)
6430 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
6434 if x1.Op != Op386MOVBload {
6437 i1 := auxIntToInt32(x1.AuxInt)
6438 if auxToSym(x1.Aux) != s {
6442 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)) {
6445 b = mergePoint(b, x0, x1)
6446 v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
6448 v0.AuxInt = int32ToAuxInt(i0)
6449 v0.Aux = symToAux(s)
6455 // match: (ORL x0:(MOVBload [i] {s} p0 mem) s0:(SHLLconst [8] x1:(MOVBload [i] {s} p1 mem)))
6456 // cond: x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && sequentialAddresses(p0, p1, 1) && mergePoint(b,x0,x1) != nil && clobber(x0, x1, s0)
6457 // result: @mergePoint(b,x0,x1) (MOVWload [i] {s} p0 mem)
6459 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6461 if x0.Op != Op386MOVBload {
6464 i := auxIntToInt32(x0.AuxInt)
6465 s := auxToSym(x0.Aux)
6469 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
6473 if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
6478 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)) {
6481 b = mergePoint(b, x0, x1)
6482 v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
6484 v0.AuxInt = int32ToAuxInt(i)
6485 v0.Aux = symToAux(s)
6491 // 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)))
6492 // 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)
6493 // result: @mergePoint(b,x0,x1,x2) (MOVLload [i0] {s} p mem)
6495 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6497 if o0.Op != Op386ORL {
6503 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
6505 if x0.Op != Op386MOVWload {
6508 i0 := auxIntToInt32(x0.AuxInt)
6509 s := auxToSym(x0.Aux)
6513 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
6517 if x1.Op != Op386MOVBload {
6520 i2 := auxIntToInt32(x1.AuxInt)
6521 if auxToSym(x1.Aux) != s {
6525 if p != x1.Args[0] || mem != x1.Args[1] {
6529 if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
6533 if x2.Op != Op386MOVBload {
6536 i3 := auxIntToInt32(x2.AuxInt)
6537 if auxToSym(x2.Aux) != s {
6541 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)) {
6544 b = mergePoint(b, x0, x1, x2)
6545 v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
6547 v0.AuxInt = int32ToAuxInt(i0)
6548 v0.Aux = symToAux(s)
6555 // 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)))
6556 // 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)
6557 // result: @mergePoint(b,x0,x1,x2) (MOVLload [i] {s} p0 mem)
6559 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6561 if o0.Op != Op386ORL {
6567 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
6569 if x0.Op != Op386MOVWload {
6572 i := auxIntToInt32(x0.AuxInt)
6573 s := auxToSym(x0.Aux)
6577 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
6581 if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
6586 if mem != x1.Args[1] {
6590 if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
6594 if x2.Op != Op386MOVBload || auxIntToInt32(x2.AuxInt) != i || auxToSym(x2.Aux) != s {
6599 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)) {
6602 b = mergePoint(b, x0, x1, x2)
6603 v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
6605 v0.AuxInt = int32ToAuxInt(i)
6606 v0.Aux = symToAux(s)
6615 func rewriteValue386_Op386ORLconst(v *Value) bool {
6617 // match: (ORLconst [c] x)
6621 c := auxIntToInt32(v.AuxInt)
6629 // match: (ORLconst [c] _)
6631 // result: (MOVLconst [-1])
6633 c := auxIntToInt32(v.AuxInt)
6637 v.reset(Op386MOVLconst)
6638 v.AuxInt = int32ToAuxInt(-1)
6641 // match: (ORLconst [c] (MOVLconst [d]))
6642 // result: (MOVLconst [c|d])
6644 c := auxIntToInt32(v.AuxInt)
6645 if v_0.Op != Op386MOVLconst {
6648 d := auxIntToInt32(v_0.AuxInt)
6649 v.reset(Op386MOVLconst)
6650 v.AuxInt = int32ToAuxInt(c | d)
6655 func rewriteValue386_Op386ORLconstmodify(v *Value) bool {
6659 config := b.Func.Config
6660 // match: (ORLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
6661 // cond: valoff1.canAdd32(off2)
6662 // result: (ORLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
6664 valoff1 := auxIntToValAndOff(v.AuxInt)
6665 sym := auxToSym(v.Aux)
6666 if v_0.Op != Op386ADDLconst {
6669 off2 := auxIntToInt32(v_0.AuxInt)
6672 if !(valoff1.canAdd32(off2)) {
6675 v.reset(Op386ORLconstmodify)
6676 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
6677 v.Aux = symToAux(sym)
6678 v.AddArg2(base, mem)
6681 // match: (ORLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
6682 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6683 // result: (ORLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
6685 valoff1 := auxIntToValAndOff(v.AuxInt)
6686 sym1 := auxToSym(v.Aux)
6687 if v_0.Op != Op386LEAL {
6690 off2 := auxIntToInt32(v_0.AuxInt)
6691 sym2 := auxToSym(v_0.Aux)
6694 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6697 v.reset(Op386ORLconstmodify)
6698 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
6699 v.Aux = symToAux(mergeSym(sym1, sym2))
6700 v.AddArg2(base, mem)
6705 func rewriteValue386_Op386ORLload(v *Value) bool {
6710 config := b.Func.Config
6711 // match: (ORLload [off1] {sym} val (ADDLconst [off2] base) mem)
6712 // cond: is32Bit(int64(off1)+int64(off2))
6713 // result: (ORLload [off1+off2] {sym} val base mem)
6715 off1 := auxIntToInt32(v.AuxInt)
6716 sym := auxToSym(v.Aux)
6718 if v_1.Op != Op386ADDLconst {
6721 off2 := auxIntToInt32(v_1.AuxInt)
6724 if !(is32Bit(int64(off1) + int64(off2))) {
6727 v.reset(Op386ORLload)
6728 v.AuxInt = int32ToAuxInt(off1 + off2)
6729 v.Aux = symToAux(sym)
6730 v.AddArg3(val, base, mem)
6733 // match: (ORLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6734 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6735 // result: (ORLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6737 off1 := auxIntToInt32(v.AuxInt)
6738 sym1 := auxToSym(v.Aux)
6740 if v_1.Op != Op386LEAL {
6743 off2 := auxIntToInt32(v_1.AuxInt)
6744 sym2 := auxToSym(v_1.Aux)
6747 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6750 v.reset(Op386ORLload)
6751 v.AuxInt = int32ToAuxInt(off1 + off2)
6752 v.Aux = symToAux(mergeSym(sym1, sym2))
6753 v.AddArg3(val, base, mem)
6758 func rewriteValue386_Op386ORLmodify(v *Value) bool {
6763 config := b.Func.Config
6764 // match: (ORLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
6765 // cond: is32Bit(int64(off1)+int64(off2))
6766 // result: (ORLmodify [off1+off2] {sym} base val mem)
6768 off1 := auxIntToInt32(v.AuxInt)
6769 sym := auxToSym(v.Aux)
6770 if v_0.Op != Op386ADDLconst {
6773 off2 := auxIntToInt32(v_0.AuxInt)
6777 if !(is32Bit(int64(off1) + int64(off2))) {
6780 v.reset(Op386ORLmodify)
6781 v.AuxInt = int32ToAuxInt(off1 + off2)
6782 v.Aux = symToAux(sym)
6783 v.AddArg3(base, val, mem)
6786 // match: (ORLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
6787 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6788 // result: (ORLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
6790 off1 := auxIntToInt32(v.AuxInt)
6791 sym1 := auxToSym(v.Aux)
6792 if v_0.Op != Op386LEAL {
6795 off2 := auxIntToInt32(v_0.AuxInt)
6796 sym2 := auxToSym(v_0.Aux)
6800 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6803 v.reset(Op386ORLmodify)
6804 v.AuxInt = int32ToAuxInt(off1 + off2)
6805 v.Aux = symToAux(mergeSym(sym1, sym2))
6806 v.AddArg3(base, val, mem)
6811 func rewriteValue386_Op386ROLBconst(v *Value) bool {
6813 // match: (ROLBconst [c] (ROLBconst [d] x))
6814 // result: (ROLBconst [(c+d)& 7] x)
6816 c := auxIntToInt8(v.AuxInt)
6817 if v_0.Op != Op386ROLBconst {
6820 d := auxIntToInt8(v_0.AuxInt)
6822 v.reset(Op386ROLBconst)
6823 v.AuxInt = int8ToAuxInt((c + d) & 7)
6827 // match: (ROLBconst [0] x)
6830 if auxIntToInt8(v.AuxInt) != 0 {
6839 func rewriteValue386_Op386ROLLconst(v *Value) bool {
6841 // match: (ROLLconst [c] (ROLLconst [d] x))
6842 // result: (ROLLconst [(c+d)&31] x)
6844 c := auxIntToInt32(v.AuxInt)
6845 if v_0.Op != Op386ROLLconst {
6848 d := auxIntToInt32(v_0.AuxInt)
6850 v.reset(Op386ROLLconst)
6851 v.AuxInt = int32ToAuxInt((c + d) & 31)
6855 // match: (ROLLconst [0] x)
6858 if auxIntToInt32(v.AuxInt) != 0 {
6867 func rewriteValue386_Op386ROLWconst(v *Value) bool {
6869 // match: (ROLWconst [c] (ROLWconst [d] x))
6870 // result: (ROLWconst [(c+d)&15] x)
6872 c := auxIntToInt16(v.AuxInt)
6873 if v_0.Op != Op386ROLWconst {
6876 d := auxIntToInt16(v_0.AuxInt)
6878 v.reset(Op386ROLWconst)
6879 v.AuxInt = int16ToAuxInt((c + d) & 15)
6883 // match: (ROLWconst [0] x)
6886 if auxIntToInt16(v.AuxInt) != 0 {
6895 func rewriteValue386_Op386SARB(v *Value) bool {
6898 // match: (SARB x (MOVLconst [c]))
6899 // result: (SARBconst [int8(min(int64(c&31),7))] x)
6902 if v_1.Op != Op386MOVLconst {
6905 c := auxIntToInt32(v_1.AuxInt)
6906 v.reset(Op386SARBconst)
6907 v.AuxInt = int8ToAuxInt(int8(min(int64(c&31), 7)))
6913 func rewriteValue386_Op386SARBconst(v *Value) bool {
6915 // match: (SARBconst x [0])
6918 if auxIntToInt8(v.AuxInt) != 0 {
6925 // match: (SARBconst [c] (MOVLconst [d]))
6926 // result: (MOVLconst [d>>uint64(c)])
6928 c := auxIntToInt8(v.AuxInt)
6929 if v_0.Op != Op386MOVLconst {
6932 d := auxIntToInt32(v_0.AuxInt)
6933 v.reset(Op386MOVLconst)
6934 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6939 func rewriteValue386_Op386SARL(v *Value) bool {
6942 // match: (SARL x (MOVLconst [c]))
6943 // result: (SARLconst [c&31] x)
6946 if v_1.Op != Op386MOVLconst {
6949 c := auxIntToInt32(v_1.AuxInt)
6950 v.reset(Op386SARLconst)
6951 v.AuxInt = int32ToAuxInt(c & 31)
6955 // match: (SARL x (ANDLconst [31] y))
6956 // result: (SARL x y)
6959 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
6969 func rewriteValue386_Op386SARLconst(v *Value) bool {
6971 // match: (SARLconst x [0])
6974 if auxIntToInt32(v.AuxInt) != 0 {
6981 // match: (SARLconst [c] (MOVLconst [d]))
6982 // result: (MOVLconst [d>>uint64(c)])
6984 c := auxIntToInt32(v.AuxInt)
6985 if v_0.Op != Op386MOVLconst {
6988 d := auxIntToInt32(v_0.AuxInt)
6989 v.reset(Op386MOVLconst)
6990 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6995 func rewriteValue386_Op386SARW(v *Value) bool {
6998 // match: (SARW x (MOVLconst [c]))
6999 // result: (SARWconst [int16(min(int64(c&31),15))] x)
7002 if v_1.Op != Op386MOVLconst {
7005 c := auxIntToInt32(v_1.AuxInt)
7006 v.reset(Op386SARWconst)
7007 v.AuxInt = int16ToAuxInt(int16(min(int64(c&31), 15)))
7013 func rewriteValue386_Op386SARWconst(v *Value) bool {
7015 // match: (SARWconst x [0])
7018 if auxIntToInt16(v.AuxInt) != 0 {
7025 // match: (SARWconst [c] (MOVLconst [d]))
7026 // result: (MOVLconst [d>>uint64(c)])
7028 c := auxIntToInt16(v.AuxInt)
7029 if v_0.Op != Op386MOVLconst {
7032 d := auxIntToInt32(v_0.AuxInt)
7033 v.reset(Op386MOVLconst)
7034 v.AuxInt = int32ToAuxInt(d >> uint64(c))
7039 func rewriteValue386_Op386SBBL(v *Value) bool {
7043 // match: (SBBL x (MOVLconst [c]) f)
7044 // result: (SBBLconst [c] x f)
7047 if v_1.Op != Op386MOVLconst {
7050 c := auxIntToInt32(v_1.AuxInt)
7052 v.reset(Op386SBBLconst)
7053 v.AuxInt = int32ToAuxInt(c)
7059 func rewriteValue386_Op386SBBLcarrymask(v *Value) bool {
7061 // match: (SBBLcarrymask (FlagEQ))
7062 // result: (MOVLconst [0])
7064 if v_0.Op != Op386FlagEQ {
7067 v.reset(Op386MOVLconst)
7068 v.AuxInt = int32ToAuxInt(0)
7071 // match: (SBBLcarrymask (FlagLT_ULT))
7072 // result: (MOVLconst [-1])
7074 if v_0.Op != Op386FlagLT_ULT {
7077 v.reset(Op386MOVLconst)
7078 v.AuxInt = int32ToAuxInt(-1)
7081 // match: (SBBLcarrymask (FlagLT_UGT))
7082 // result: (MOVLconst [0])
7084 if v_0.Op != Op386FlagLT_UGT {
7087 v.reset(Op386MOVLconst)
7088 v.AuxInt = int32ToAuxInt(0)
7091 // match: (SBBLcarrymask (FlagGT_ULT))
7092 // result: (MOVLconst [-1])
7094 if v_0.Op != Op386FlagGT_ULT {
7097 v.reset(Op386MOVLconst)
7098 v.AuxInt = int32ToAuxInt(-1)
7101 // match: (SBBLcarrymask (FlagGT_UGT))
7102 // result: (MOVLconst [0])
7104 if v_0.Op != Op386FlagGT_UGT {
7107 v.reset(Op386MOVLconst)
7108 v.AuxInt = int32ToAuxInt(0)
7113 func rewriteValue386_Op386SETA(v *Value) bool {
7115 // match: (SETA (InvertFlags x))
7118 if v_0.Op != Op386InvertFlags {
7126 // match: (SETA (FlagEQ))
7127 // result: (MOVLconst [0])
7129 if v_0.Op != Op386FlagEQ {
7132 v.reset(Op386MOVLconst)
7133 v.AuxInt = int32ToAuxInt(0)
7136 // match: (SETA (FlagLT_ULT))
7137 // result: (MOVLconst [0])
7139 if v_0.Op != Op386FlagLT_ULT {
7142 v.reset(Op386MOVLconst)
7143 v.AuxInt = int32ToAuxInt(0)
7146 // match: (SETA (FlagLT_UGT))
7147 // result: (MOVLconst [1])
7149 if v_0.Op != Op386FlagLT_UGT {
7152 v.reset(Op386MOVLconst)
7153 v.AuxInt = int32ToAuxInt(1)
7156 // match: (SETA (FlagGT_ULT))
7157 // result: (MOVLconst [0])
7159 if v_0.Op != Op386FlagGT_ULT {
7162 v.reset(Op386MOVLconst)
7163 v.AuxInt = int32ToAuxInt(0)
7166 // match: (SETA (FlagGT_UGT))
7167 // result: (MOVLconst [1])
7169 if v_0.Op != Op386FlagGT_UGT {
7172 v.reset(Op386MOVLconst)
7173 v.AuxInt = int32ToAuxInt(1)
7178 func rewriteValue386_Op386SETAE(v *Value) bool {
7180 // match: (SETAE (InvertFlags x))
7181 // result: (SETBE x)
7183 if v_0.Op != Op386InvertFlags {
7191 // match: (SETAE (FlagEQ))
7192 // result: (MOVLconst [1])
7194 if v_0.Op != Op386FlagEQ {
7197 v.reset(Op386MOVLconst)
7198 v.AuxInt = int32ToAuxInt(1)
7201 // match: (SETAE (FlagLT_ULT))
7202 // result: (MOVLconst [0])
7204 if v_0.Op != Op386FlagLT_ULT {
7207 v.reset(Op386MOVLconst)
7208 v.AuxInt = int32ToAuxInt(0)
7211 // match: (SETAE (FlagLT_UGT))
7212 // result: (MOVLconst [1])
7214 if v_0.Op != Op386FlagLT_UGT {
7217 v.reset(Op386MOVLconst)
7218 v.AuxInt = int32ToAuxInt(1)
7221 // match: (SETAE (FlagGT_ULT))
7222 // result: (MOVLconst [0])
7224 if v_0.Op != Op386FlagGT_ULT {
7227 v.reset(Op386MOVLconst)
7228 v.AuxInt = int32ToAuxInt(0)
7231 // match: (SETAE (FlagGT_UGT))
7232 // result: (MOVLconst [1])
7234 if v_0.Op != Op386FlagGT_UGT {
7237 v.reset(Op386MOVLconst)
7238 v.AuxInt = int32ToAuxInt(1)
7243 func rewriteValue386_Op386SETB(v *Value) bool {
7245 // match: (SETB (InvertFlags x))
7248 if v_0.Op != Op386InvertFlags {
7256 // match: (SETB (FlagEQ))
7257 // result: (MOVLconst [0])
7259 if v_0.Op != Op386FlagEQ {
7262 v.reset(Op386MOVLconst)
7263 v.AuxInt = int32ToAuxInt(0)
7266 // match: (SETB (FlagLT_ULT))
7267 // result: (MOVLconst [1])
7269 if v_0.Op != Op386FlagLT_ULT {
7272 v.reset(Op386MOVLconst)
7273 v.AuxInt = int32ToAuxInt(1)
7276 // match: (SETB (FlagLT_UGT))
7277 // result: (MOVLconst [0])
7279 if v_0.Op != Op386FlagLT_UGT {
7282 v.reset(Op386MOVLconst)
7283 v.AuxInt = int32ToAuxInt(0)
7286 // match: (SETB (FlagGT_ULT))
7287 // result: (MOVLconst [1])
7289 if v_0.Op != Op386FlagGT_ULT {
7292 v.reset(Op386MOVLconst)
7293 v.AuxInt = int32ToAuxInt(1)
7296 // match: (SETB (FlagGT_UGT))
7297 // result: (MOVLconst [0])
7299 if v_0.Op != Op386FlagGT_UGT {
7302 v.reset(Op386MOVLconst)
7303 v.AuxInt = int32ToAuxInt(0)
7308 func rewriteValue386_Op386SETBE(v *Value) bool {
7310 // match: (SETBE (InvertFlags x))
7311 // result: (SETAE x)
7313 if v_0.Op != Op386InvertFlags {
7321 // match: (SETBE (FlagEQ))
7322 // result: (MOVLconst [1])
7324 if v_0.Op != Op386FlagEQ {
7327 v.reset(Op386MOVLconst)
7328 v.AuxInt = int32ToAuxInt(1)
7331 // match: (SETBE (FlagLT_ULT))
7332 // result: (MOVLconst [1])
7334 if v_0.Op != Op386FlagLT_ULT {
7337 v.reset(Op386MOVLconst)
7338 v.AuxInt = int32ToAuxInt(1)
7341 // match: (SETBE (FlagLT_UGT))
7342 // result: (MOVLconst [0])
7344 if v_0.Op != Op386FlagLT_UGT {
7347 v.reset(Op386MOVLconst)
7348 v.AuxInt = int32ToAuxInt(0)
7351 // match: (SETBE (FlagGT_ULT))
7352 // result: (MOVLconst [1])
7354 if v_0.Op != Op386FlagGT_ULT {
7357 v.reset(Op386MOVLconst)
7358 v.AuxInt = int32ToAuxInt(1)
7361 // match: (SETBE (FlagGT_UGT))
7362 // result: (MOVLconst [0])
7364 if v_0.Op != Op386FlagGT_UGT {
7367 v.reset(Op386MOVLconst)
7368 v.AuxInt = int32ToAuxInt(0)
7373 func rewriteValue386_Op386SETEQ(v *Value) bool {
7375 // match: (SETEQ (InvertFlags x))
7376 // result: (SETEQ x)
7378 if v_0.Op != Op386InvertFlags {
7386 // match: (SETEQ (FlagEQ))
7387 // result: (MOVLconst [1])
7389 if v_0.Op != Op386FlagEQ {
7392 v.reset(Op386MOVLconst)
7393 v.AuxInt = int32ToAuxInt(1)
7396 // match: (SETEQ (FlagLT_ULT))
7397 // result: (MOVLconst [0])
7399 if v_0.Op != Op386FlagLT_ULT {
7402 v.reset(Op386MOVLconst)
7403 v.AuxInt = int32ToAuxInt(0)
7406 // match: (SETEQ (FlagLT_UGT))
7407 // result: (MOVLconst [0])
7409 if v_0.Op != Op386FlagLT_UGT {
7412 v.reset(Op386MOVLconst)
7413 v.AuxInt = int32ToAuxInt(0)
7416 // match: (SETEQ (FlagGT_ULT))
7417 // result: (MOVLconst [0])
7419 if v_0.Op != Op386FlagGT_ULT {
7422 v.reset(Op386MOVLconst)
7423 v.AuxInt = int32ToAuxInt(0)
7426 // match: (SETEQ (FlagGT_UGT))
7427 // result: (MOVLconst [0])
7429 if v_0.Op != Op386FlagGT_UGT {
7432 v.reset(Op386MOVLconst)
7433 v.AuxInt = int32ToAuxInt(0)
7438 func rewriteValue386_Op386SETG(v *Value) bool {
7440 // match: (SETG (InvertFlags x))
7443 if v_0.Op != Op386InvertFlags {
7451 // match: (SETG (FlagEQ))
7452 // result: (MOVLconst [0])
7454 if v_0.Op != Op386FlagEQ {
7457 v.reset(Op386MOVLconst)
7458 v.AuxInt = int32ToAuxInt(0)
7461 // match: (SETG (FlagLT_ULT))
7462 // result: (MOVLconst [0])
7464 if v_0.Op != Op386FlagLT_ULT {
7467 v.reset(Op386MOVLconst)
7468 v.AuxInt = int32ToAuxInt(0)
7471 // match: (SETG (FlagLT_UGT))
7472 // result: (MOVLconst [0])
7474 if v_0.Op != Op386FlagLT_UGT {
7477 v.reset(Op386MOVLconst)
7478 v.AuxInt = int32ToAuxInt(0)
7481 // match: (SETG (FlagGT_ULT))
7482 // result: (MOVLconst [1])
7484 if v_0.Op != Op386FlagGT_ULT {
7487 v.reset(Op386MOVLconst)
7488 v.AuxInt = int32ToAuxInt(1)
7491 // match: (SETG (FlagGT_UGT))
7492 // result: (MOVLconst [1])
7494 if v_0.Op != Op386FlagGT_UGT {
7497 v.reset(Op386MOVLconst)
7498 v.AuxInt = int32ToAuxInt(1)
7503 func rewriteValue386_Op386SETGE(v *Value) bool {
7505 // match: (SETGE (InvertFlags x))
7506 // result: (SETLE x)
7508 if v_0.Op != Op386InvertFlags {
7516 // match: (SETGE (FlagEQ))
7517 // result: (MOVLconst [1])
7519 if v_0.Op != Op386FlagEQ {
7522 v.reset(Op386MOVLconst)
7523 v.AuxInt = int32ToAuxInt(1)
7526 // match: (SETGE (FlagLT_ULT))
7527 // result: (MOVLconst [0])
7529 if v_0.Op != Op386FlagLT_ULT {
7532 v.reset(Op386MOVLconst)
7533 v.AuxInt = int32ToAuxInt(0)
7536 // match: (SETGE (FlagLT_UGT))
7537 // result: (MOVLconst [0])
7539 if v_0.Op != Op386FlagLT_UGT {
7542 v.reset(Op386MOVLconst)
7543 v.AuxInt = int32ToAuxInt(0)
7546 // match: (SETGE (FlagGT_ULT))
7547 // result: (MOVLconst [1])
7549 if v_0.Op != Op386FlagGT_ULT {
7552 v.reset(Op386MOVLconst)
7553 v.AuxInt = int32ToAuxInt(1)
7556 // match: (SETGE (FlagGT_UGT))
7557 // result: (MOVLconst [1])
7559 if v_0.Op != Op386FlagGT_UGT {
7562 v.reset(Op386MOVLconst)
7563 v.AuxInt = int32ToAuxInt(1)
7568 func rewriteValue386_Op386SETL(v *Value) bool {
7570 // match: (SETL (InvertFlags x))
7573 if v_0.Op != Op386InvertFlags {
7581 // match: (SETL (FlagEQ))
7582 // result: (MOVLconst [0])
7584 if v_0.Op != Op386FlagEQ {
7587 v.reset(Op386MOVLconst)
7588 v.AuxInt = int32ToAuxInt(0)
7591 // match: (SETL (FlagLT_ULT))
7592 // result: (MOVLconst [1])
7594 if v_0.Op != Op386FlagLT_ULT {
7597 v.reset(Op386MOVLconst)
7598 v.AuxInt = int32ToAuxInt(1)
7601 // match: (SETL (FlagLT_UGT))
7602 // result: (MOVLconst [1])
7604 if v_0.Op != Op386FlagLT_UGT {
7607 v.reset(Op386MOVLconst)
7608 v.AuxInt = int32ToAuxInt(1)
7611 // match: (SETL (FlagGT_ULT))
7612 // result: (MOVLconst [0])
7614 if v_0.Op != Op386FlagGT_ULT {
7617 v.reset(Op386MOVLconst)
7618 v.AuxInt = int32ToAuxInt(0)
7621 // match: (SETL (FlagGT_UGT))
7622 // result: (MOVLconst [0])
7624 if v_0.Op != Op386FlagGT_UGT {
7627 v.reset(Op386MOVLconst)
7628 v.AuxInt = int32ToAuxInt(0)
7633 func rewriteValue386_Op386SETLE(v *Value) bool {
7635 // match: (SETLE (InvertFlags x))
7636 // result: (SETGE x)
7638 if v_0.Op != Op386InvertFlags {
7646 // match: (SETLE (FlagEQ))
7647 // result: (MOVLconst [1])
7649 if v_0.Op != Op386FlagEQ {
7652 v.reset(Op386MOVLconst)
7653 v.AuxInt = int32ToAuxInt(1)
7656 // match: (SETLE (FlagLT_ULT))
7657 // result: (MOVLconst [1])
7659 if v_0.Op != Op386FlagLT_ULT {
7662 v.reset(Op386MOVLconst)
7663 v.AuxInt = int32ToAuxInt(1)
7666 // match: (SETLE (FlagLT_UGT))
7667 // result: (MOVLconst [1])
7669 if v_0.Op != Op386FlagLT_UGT {
7672 v.reset(Op386MOVLconst)
7673 v.AuxInt = int32ToAuxInt(1)
7676 // match: (SETLE (FlagGT_ULT))
7677 // result: (MOVLconst [0])
7679 if v_0.Op != Op386FlagGT_ULT {
7682 v.reset(Op386MOVLconst)
7683 v.AuxInt = int32ToAuxInt(0)
7686 // match: (SETLE (FlagGT_UGT))
7687 // result: (MOVLconst [0])
7689 if v_0.Op != Op386FlagGT_UGT {
7692 v.reset(Op386MOVLconst)
7693 v.AuxInt = int32ToAuxInt(0)
7698 func rewriteValue386_Op386SETNE(v *Value) bool {
7700 // match: (SETNE (InvertFlags x))
7701 // result: (SETNE x)
7703 if v_0.Op != Op386InvertFlags {
7711 // match: (SETNE (FlagEQ))
7712 // result: (MOVLconst [0])
7714 if v_0.Op != Op386FlagEQ {
7717 v.reset(Op386MOVLconst)
7718 v.AuxInt = int32ToAuxInt(0)
7721 // match: (SETNE (FlagLT_ULT))
7722 // result: (MOVLconst [1])
7724 if v_0.Op != Op386FlagLT_ULT {
7727 v.reset(Op386MOVLconst)
7728 v.AuxInt = int32ToAuxInt(1)
7731 // match: (SETNE (FlagLT_UGT))
7732 // result: (MOVLconst [1])
7734 if v_0.Op != Op386FlagLT_UGT {
7737 v.reset(Op386MOVLconst)
7738 v.AuxInt = int32ToAuxInt(1)
7741 // match: (SETNE (FlagGT_ULT))
7742 // result: (MOVLconst [1])
7744 if v_0.Op != Op386FlagGT_ULT {
7747 v.reset(Op386MOVLconst)
7748 v.AuxInt = int32ToAuxInt(1)
7751 // match: (SETNE (FlagGT_UGT))
7752 // result: (MOVLconst [1])
7754 if v_0.Op != Op386FlagGT_UGT {
7757 v.reset(Op386MOVLconst)
7758 v.AuxInt = int32ToAuxInt(1)
7763 func rewriteValue386_Op386SHLL(v *Value) bool {
7766 // match: (SHLL x (MOVLconst [c]))
7767 // result: (SHLLconst [c&31] x)
7770 if v_1.Op != Op386MOVLconst {
7773 c := auxIntToInt32(v_1.AuxInt)
7774 v.reset(Op386SHLLconst)
7775 v.AuxInt = int32ToAuxInt(c & 31)
7779 // match: (SHLL x (ANDLconst [31] y))
7780 // result: (SHLL x y)
7783 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
7793 func rewriteValue386_Op386SHLLconst(v *Value) bool {
7795 // match: (SHLLconst x [0])
7798 if auxIntToInt32(v.AuxInt) != 0 {
7807 func rewriteValue386_Op386SHRB(v *Value) bool {
7810 // match: (SHRB x (MOVLconst [c]))
7812 // result: (SHRBconst [int8(c&31)] x)
7815 if v_1.Op != Op386MOVLconst {
7818 c := auxIntToInt32(v_1.AuxInt)
7822 v.reset(Op386SHRBconst)
7823 v.AuxInt = int8ToAuxInt(int8(c & 31))
7827 // match: (SHRB _ (MOVLconst [c]))
7829 // result: (MOVLconst [0])
7831 if v_1.Op != Op386MOVLconst {
7834 c := auxIntToInt32(v_1.AuxInt)
7838 v.reset(Op386MOVLconst)
7839 v.AuxInt = int32ToAuxInt(0)
7844 func rewriteValue386_Op386SHRBconst(v *Value) bool {
7846 // match: (SHRBconst x [0])
7849 if auxIntToInt8(v.AuxInt) != 0 {
7858 func rewriteValue386_Op386SHRL(v *Value) bool {
7861 // match: (SHRL x (MOVLconst [c]))
7862 // result: (SHRLconst [c&31] x)
7865 if v_1.Op != Op386MOVLconst {
7868 c := auxIntToInt32(v_1.AuxInt)
7869 v.reset(Op386SHRLconst)
7870 v.AuxInt = int32ToAuxInt(c & 31)
7874 // match: (SHRL x (ANDLconst [31] y))
7875 // result: (SHRL x y)
7878 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
7888 func rewriteValue386_Op386SHRLconst(v *Value) bool {
7890 // match: (SHRLconst x [0])
7893 if auxIntToInt32(v.AuxInt) != 0 {
7902 func rewriteValue386_Op386SHRW(v *Value) bool {
7905 // match: (SHRW x (MOVLconst [c]))
7907 // result: (SHRWconst [int16(c&31)] x)
7910 if v_1.Op != Op386MOVLconst {
7913 c := auxIntToInt32(v_1.AuxInt)
7917 v.reset(Op386SHRWconst)
7918 v.AuxInt = int16ToAuxInt(int16(c & 31))
7922 // match: (SHRW _ (MOVLconst [c]))
7924 // result: (MOVLconst [0])
7926 if v_1.Op != Op386MOVLconst {
7929 c := auxIntToInt32(v_1.AuxInt)
7933 v.reset(Op386MOVLconst)
7934 v.AuxInt = int32ToAuxInt(0)
7939 func rewriteValue386_Op386SHRWconst(v *Value) bool {
7941 // match: (SHRWconst x [0])
7944 if auxIntToInt16(v.AuxInt) != 0 {
7953 func rewriteValue386_Op386SUBL(v *Value) bool {
7957 // match: (SUBL x (MOVLconst [c]))
7958 // result: (SUBLconst x [c])
7961 if v_1.Op != Op386MOVLconst {
7964 c := auxIntToInt32(v_1.AuxInt)
7965 v.reset(Op386SUBLconst)
7966 v.AuxInt = int32ToAuxInt(c)
7970 // match: (SUBL (MOVLconst [c]) x)
7971 // result: (NEGL (SUBLconst <v.Type> x [c]))
7973 if v_0.Op != Op386MOVLconst {
7976 c := auxIntToInt32(v_0.AuxInt)
7979 v0 := b.NewValue0(v.Pos, Op386SUBLconst, v.Type)
7980 v0.AuxInt = int32ToAuxInt(c)
7985 // match: (SUBL x l:(MOVLload [off] {sym} ptr mem))
7986 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
7987 // result: (SUBLload x [off] {sym} ptr mem)
7991 if l.Op != Op386MOVLload {
7994 off := auxIntToInt32(l.AuxInt)
7995 sym := auxToSym(l.Aux)
7998 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8001 v.reset(Op386SUBLload)
8002 v.AuxInt = int32ToAuxInt(off)
8003 v.Aux = symToAux(sym)
8004 v.AddArg3(x, ptr, mem)
8007 // match: (SUBL x x)
8008 // result: (MOVLconst [0])
8014 v.reset(Op386MOVLconst)
8015 v.AuxInt = int32ToAuxInt(0)
8020 func rewriteValue386_Op386SUBLcarry(v *Value) bool {
8023 // match: (SUBLcarry x (MOVLconst [c]))
8024 // result: (SUBLconstcarry [c] x)
8027 if v_1.Op != Op386MOVLconst {
8030 c := auxIntToInt32(v_1.AuxInt)
8031 v.reset(Op386SUBLconstcarry)
8032 v.AuxInt = int32ToAuxInt(c)
8038 func rewriteValue386_Op386SUBLconst(v *Value) bool {
8040 // match: (SUBLconst [c] x)
8044 c := auxIntToInt32(v.AuxInt)
8052 // match: (SUBLconst [c] x)
8053 // result: (ADDLconst [-c] x)
8055 c := auxIntToInt32(v.AuxInt)
8057 v.reset(Op386ADDLconst)
8058 v.AuxInt = int32ToAuxInt(-c)
8063 func rewriteValue386_Op386SUBLload(v *Value) bool {
8068 config := b.Func.Config
8069 // match: (SUBLload [off1] {sym} val (ADDLconst [off2] base) mem)
8070 // cond: is32Bit(int64(off1)+int64(off2))
8071 // result: (SUBLload [off1+off2] {sym} val base mem)
8073 off1 := auxIntToInt32(v.AuxInt)
8074 sym := auxToSym(v.Aux)
8076 if v_1.Op != Op386ADDLconst {
8079 off2 := auxIntToInt32(v_1.AuxInt)
8082 if !(is32Bit(int64(off1) + int64(off2))) {
8085 v.reset(Op386SUBLload)
8086 v.AuxInt = int32ToAuxInt(off1 + off2)
8087 v.Aux = symToAux(sym)
8088 v.AddArg3(val, base, mem)
8091 // match: (SUBLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8092 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8093 // result: (SUBLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8095 off1 := auxIntToInt32(v.AuxInt)
8096 sym1 := auxToSym(v.Aux)
8098 if v_1.Op != Op386LEAL {
8101 off2 := auxIntToInt32(v_1.AuxInt)
8102 sym2 := auxToSym(v_1.Aux)
8105 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8108 v.reset(Op386SUBLload)
8109 v.AuxInt = int32ToAuxInt(off1 + off2)
8110 v.Aux = symToAux(mergeSym(sym1, sym2))
8111 v.AddArg3(val, base, mem)
8116 func rewriteValue386_Op386SUBLmodify(v *Value) bool {
8121 config := b.Func.Config
8122 // match: (SUBLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
8123 // cond: is32Bit(int64(off1)+int64(off2))
8124 // result: (SUBLmodify [off1+off2] {sym} base val mem)
8126 off1 := auxIntToInt32(v.AuxInt)
8127 sym := auxToSym(v.Aux)
8128 if v_0.Op != Op386ADDLconst {
8131 off2 := auxIntToInt32(v_0.AuxInt)
8135 if !(is32Bit(int64(off1) + int64(off2))) {
8138 v.reset(Op386SUBLmodify)
8139 v.AuxInt = int32ToAuxInt(off1 + off2)
8140 v.Aux = symToAux(sym)
8141 v.AddArg3(base, val, mem)
8144 // match: (SUBLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
8145 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8146 // result: (SUBLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
8148 off1 := auxIntToInt32(v.AuxInt)
8149 sym1 := auxToSym(v.Aux)
8150 if v_0.Op != Op386LEAL {
8153 off2 := auxIntToInt32(v_0.AuxInt)
8154 sym2 := auxToSym(v_0.Aux)
8158 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8161 v.reset(Op386SUBLmodify)
8162 v.AuxInt = int32ToAuxInt(off1 + off2)
8163 v.Aux = symToAux(mergeSym(sym1, sym2))
8164 v.AddArg3(base, val, mem)
8169 func rewriteValue386_Op386SUBSD(v *Value) bool {
8172 // match: (SUBSD x l:(MOVSDload [off] {sym} ptr mem))
8173 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8174 // result: (SUBSDload x [off] {sym} ptr mem)
8178 if l.Op != Op386MOVSDload {
8181 off := auxIntToInt32(l.AuxInt)
8182 sym := auxToSym(l.Aux)
8185 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8188 v.reset(Op386SUBSDload)
8189 v.AuxInt = int32ToAuxInt(off)
8190 v.Aux = symToAux(sym)
8191 v.AddArg3(x, ptr, mem)
8196 func rewriteValue386_Op386SUBSDload(v *Value) bool {
8201 config := b.Func.Config
8202 // match: (SUBSDload [off1] {sym} val (ADDLconst [off2] base) mem)
8203 // cond: is32Bit(int64(off1)+int64(off2))
8204 // result: (SUBSDload [off1+off2] {sym} val base mem)
8206 off1 := auxIntToInt32(v.AuxInt)
8207 sym := auxToSym(v.Aux)
8209 if v_1.Op != Op386ADDLconst {
8212 off2 := auxIntToInt32(v_1.AuxInt)
8215 if !(is32Bit(int64(off1) + int64(off2))) {
8218 v.reset(Op386SUBSDload)
8219 v.AuxInt = int32ToAuxInt(off1 + off2)
8220 v.Aux = symToAux(sym)
8221 v.AddArg3(val, base, mem)
8224 // match: (SUBSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8225 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8226 // result: (SUBSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8228 off1 := auxIntToInt32(v.AuxInt)
8229 sym1 := auxToSym(v.Aux)
8231 if v_1.Op != Op386LEAL {
8234 off2 := auxIntToInt32(v_1.AuxInt)
8235 sym2 := auxToSym(v_1.Aux)
8238 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8241 v.reset(Op386SUBSDload)
8242 v.AuxInt = int32ToAuxInt(off1 + off2)
8243 v.Aux = symToAux(mergeSym(sym1, sym2))
8244 v.AddArg3(val, base, mem)
8249 func rewriteValue386_Op386SUBSS(v *Value) bool {
8252 // match: (SUBSS x l:(MOVSSload [off] {sym} ptr mem))
8253 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8254 // result: (SUBSSload x [off] {sym} ptr mem)
8258 if l.Op != Op386MOVSSload {
8261 off := auxIntToInt32(l.AuxInt)
8262 sym := auxToSym(l.Aux)
8265 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8268 v.reset(Op386SUBSSload)
8269 v.AuxInt = int32ToAuxInt(off)
8270 v.Aux = symToAux(sym)
8271 v.AddArg3(x, ptr, mem)
8276 func rewriteValue386_Op386SUBSSload(v *Value) bool {
8281 config := b.Func.Config
8282 // match: (SUBSSload [off1] {sym} val (ADDLconst [off2] base) mem)
8283 // cond: is32Bit(int64(off1)+int64(off2))
8284 // result: (SUBSSload [off1+off2] {sym} val base mem)
8286 off1 := auxIntToInt32(v.AuxInt)
8287 sym := auxToSym(v.Aux)
8289 if v_1.Op != Op386ADDLconst {
8292 off2 := auxIntToInt32(v_1.AuxInt)
8295 if !(is32Bit(int64(off1) + int64(off2))) {
8298 v.reset(Op386SUBSSload)
8299 v.AuxInt = int32ToAuxInt(off1 + off2)
8300 v.Aux = symToAux(sym)
8301 v.AddArg3(val, base, mem)
8304 // match: (SUBSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8305 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8306 // result: (SUBSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8308 off1 := auxIntToInt32(v.AuxInt)
8309 sym1 := auxToSym(v.Aux)
8311 if v_1.Op != Op386LEAL {
8314 off2 := auxIntToInt32(v_1.AuxInt)
8315 sym2 := auxToSym(v_1.Aux)
8318 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8321 v.reset(Op386SUBSSload)
8322 v.AuxInt = int32ToAuxInt(off1 + off2)
8323 v.Aux = symToAux(mergeSym(sym1, sym2))
8324 v.AddArg3(val, base, mem)
8329 func rewriteValue386_Op386XORL(v *Value) bool {
8332 // match: (XORL x (MOVLconst [c]))
8333 // result: (XORLconst [c] x)
8335 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8337 if v_1.Op != Op386MOVLconst {
8340 c := auxIntToInt32(v_1.AuxInt)
8341 v.reset(Op386XORLconst)
8342 v.AuxInt = int32ToAuxInt(c)
8348 // match: (XORL (SHLLconst [c] x) (SHRLconst [d] x))
8350 // result: (ROLLconst [c] x)
8352 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8353 if v_0.Op != Op386SHLLconst {
8356 c := auxIntToInt32(v_0.AuxInt)
8358 if v_1.Op != Op386SHRLconst {
8361 d := auxIntToInt32(v_1.AuxInt)
8362 if x != v_1.Args[0] || !(d == 32-c) {
8365 v.reset(Op386ROLLconst)
8366 v.AuxInt = int32ToAuxInt(c)
8372 // match: (XORL <t> (SHLLconst x [c]) (SHRWconst x [d]))
8373 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
8374 // result: (ROLWconst x [int16(c)])
8377 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8378 if v_0.Op != Op386SHLLconst {
8381 c := auxIntToInt32(v_0.AuxInt)
8383 if v_1.Op != Op386SHRWconst {
8386 d := auxIntToInt16(v_1.AuxInt)
8387 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
8390 v.reset(Op386ROLWconst)
8391 v.AuxInt = int16ToAuxInt(int16(c))
8397 // match: (XORL <t> (SHLLconst x [c]) (SHRBconst x [d]))
8398 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
8399 // result: (ROLBconst x [int8(c)])
8402 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8403 if v_0.Op != Op386SHLLconst {
8406 c := auxIntToInt32(v_0.AuxInt)
8408 if v_1.Op != Op386SHRBconst {
8411 d := auxIntToInt8(v_1.AuxInt)
8412 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
8415 v.reset(Op386ROLBconst)
8416 v.AuxInt = int8ToAuxInt(int8(c))
8422 // match: (XORL x l:(MOVLload [off] {sym} ptr mem))
8423 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8424 // result: (XORLload x [off] {sym} ptr mem)
8426 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8429 if l.Op != Op386MOVLload {
8432 off := auxIntToInt32(l.AuxInt)
8433 sym := auxToSym(l.Aux)
8436 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8439 v.reset(Op386XORLload)
8440 v.AuxInt = int32ToAuxInt(off)
8441 v.Aux = symToAux(sym)
8442 v.AddArg3(x, ptr, mem)
8447 // match: (XORL x x)
8448 // result: (MOVLconst [0])
8454 v.reset(Op386MOVLconst)
8455 v.AuxInt = int32ToAuxInt(0)
8460 func rewriteValue386_Op386XORLconst(v *Value) bool {
8462 // match: (XORLconst [c] (XORLconst [d] x))
8463 // result: (XORLconst [c ^ d] x)
8465 c := auxIntToInt32(v.AuxInt)
8466 if v_0.Op != Op386XORLconst {
8469 d := auxIntToInt32(v_0.AuxInt)
8471 v.reset(Op386XORLconst)
8472 v.AuxInt = int32ToAuxInt(c ^ d)
8476 // match: (XORLconst [c] x)
8480 c := auxIntToInt32(v.AuxInt)
8488 // match: (XORLconst [c] (MOVLconst [d]))
8489 // result: (MOVLconst [c^d])
8491 c := auxIntToInt32(v.AuxInt)
8492 if v_0.Op != Op386MOVLconst {
8495 d := auxIntToInt32(v_0.AuxInt)
8496 v.reset(Op386MOVLconst)
8497 v.AuxInt = int32ToAuxInt(c ^ d)
8502 func rewriteValue386_Op386XORLconstmodify(v *Value) bool {
8506 config := b.Func.Config
8507 // match: (XORLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
8508 // cond: valoff1.canAdd32(off2)
8509 // result: (XORLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
8511 valoff1 := auxIntToValAndOff(v.AuxInt)
8512 sym := auxToSym(v.Aux)
8513 if v_0.Op != Op386ADDLconst {
8516 off2 := auxIntToInt32(v_0.AuxInt)
8519 if !(valoff1.canAdd32(off2)) {
8522 v.reset(Op386XORLconstmodify)
8523 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
8524 v.Aux = symToAux(sym)
8525 v.AddArg2(base, mem)
8528 // match: (XORLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
8529 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8530 // result: (XORLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
8532 valoff1 := auxIntToValAndOff(v.AuxInt)
8533 sym1 := auxToSym(v.Aux)
8534 if v_0.Op != Op386LEAL {
8537 off2 := auxIntToInt32(v_0.AuxInt)
8538 sym2 := auxToSym(v_0.Aux)
8541 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8544 v.reset(Op386XORLconstmodify)
8545 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
8546 v.Aux = symToAux(mergeSym(sym1, sym2))
8547 v.AddArg2(base, mem)
8552 func rewriteValue386_Op386XORLload(v *Value) bool {
8557 config := b.Func.Config
8558 // match: (XORLload [off1] {sym} val (ADDLconst [off2] base) mem)
8559 // cond: is32Bit(int64(off1)+int64(off2))
8560 // result: (XORLload [off1+off2] {sym} val base mem)
8562 off1 := auxIntToInt32(v.AuxInt)
8563 sym := auxToSym(v.Aux)
8565 if v_1.Op != Op386ADDLconst {
8568 off2 := auxIntToInt32(v_1.AuxInt)
8571 if !(is32Bit(int64(off1) + int64(off2))) {
8574 v.reset(Op386XORLload)
8575 v.AuxInt = int32ToAuxInt(off1 + off2)
8576 v.Aux = symToAux(sym)
8577 v.AddArg3(val, base, mem)
8580 // match: (XORLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8581 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8582 // result: (XORLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8584 off1 := auxIntToInt32(v.AuxInt)
8585 sym1 := auxToSym(v.Aux)
8587 if v_1.Op != Op386LEAL {
8590 off2 := auxIntToInt32(v_1.AuxInt)
8591 sym2 := auxToSym(v_1.Aux)
8594 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8597 v.reset(Op386XORLload)
8598 v.AuxInt = int32ToAuxInt(off1 + off2)
8599 v.Aux = symToAux(mergeSym(sym1, sym2))
8600 v.AddArg3(val, base, mem)
8605 func rewriteValue386_Op386XORLmodify(v *Value) bool {
8610 config := b.Func.Config
8611 // match: (XORLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
8612 // cond: is32Bit(int64(off1)+int64(off2))
8613 // result: (XORLmodify [off1+off2] {sym} base val mem)
8615 off1 := auxIntToInt32(v.AuxInt)
8616 sym := auxToSym(v.Aux)
8617 if v_0.Op != Op386ADDLconst {
8620 off2 := auxIntToInt32(v_0.AuxInt)
8624 if !(is32Bit(int64(off1) + int64(off2))) {
8627 v.reset(Op386XORLmodify)
8628 v.AuxInt = int32ToAuxInt(off1 + off2)
8629 v.Aux = symToAux(sym)
8630 v.AddArg3(base, val, mem)
8633 // match: (XORLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
8634 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8635 // result: (XORLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
8637 off1 := auxIntToInt32(v.AuxInt)
8638 sym1 := auxToSym(v.Aux)
8639 if v_0.Op != Op386LEAL {
8642 off2 := auxIntToInt32(v_0.AuxInt)
8643 sym2 := auxToSym(v_0.Aux)
8647 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8650 v.reset(Op386XORLmodify)
8651 v.AuxInt = int32ToAuxInt(off1 + off2)
8652 v.Aux = symToAux(mergeSym(sym1, sym2))
8653 v.AddArg3(base, val, mem)
8658 func rewriteValue386_OpAddr(v *Value) bool {
8660 // match: (Addr {sym} base)
8661 // result: (LEAL {sym} base)
8663 sym := auxToSym(v.Aux)
8666 v.Aux = symToAux(sym)
8671 func rewriteValue386_OpConst16(v *Value) bool {
8672 // match: (Const16 [c])
8673 // result: (MOVLconst [int32(c)])
8675 c := auxIntToInt16(v.AuxInt)
8676 v.reset(Op386MOVLconst)
8677 v.AuxInt = int32ToAuxInt(int32(c))
8681 func rewriteValue386_OpConst8(v *Value) bool {
8682 // match: (Const8 [c])
8683 // result: (MOVLconst [int32(c)])
8685 c := auxIntToInt8(v.AuxInt)
8686 v.reset(Op386MOVLconst)
8687 v.AuxInt = int32ToAuxInt(int32(c))
8691 func rewriteValue386_OpConstBool(v *Value) bool {
8692 // match: (ConstBool [c])
8693 // result: (MOVLconst [b2i32(c)])
8695 c := auxIntToBool(v.AuxInt)
8696 v.reset(Op386MOVLconst)
8697 v.AuxInt = int32ToAuxInt(b2i32(c))
8701 func rewriteValue386_OpConstNil(v *Value) bool {
8702 // match: (ConstNil)
8703 // result: (MOVLconst [0])
8705 v.reset(Op386MOVLconst)
8706 v.AuxInt = int32ToAuxInt(0)
8710 func rewriteValue386_OpCtz16(v *Value) bool {
8713 typ := &b.Func.Config.Types
8715 // result: (BSFL (ORLconst <typ.UInt32> [0x10000] x))
8719 v0 := b.NewValue0(v.Pos, Op386ORLconst, typ.UInt32)
8720 v0.AuxInt = int32ToAuxInt(0x10000)
8726 func rewriteValue386_OpDiv8(v *Value) bool {
8730 typ := &b.Func.Config.Types
8731 // match: (Div8 x y)
8732 // result: (DIVW (SignExt8to16 x) (SignExt8to16 y))
8737 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8739 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8745 func rewriteValue386_OpDiv8u(v *Value) bool {
8749 typ := &b.Func.Config.Types
8750 // match: (Div8u x y)
8751 // result: (DIVWU (ZeroExt8to16 x) (ZeroExt8to16 y))
8756 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8758 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8764 func rewriteValue386_OpEq16(v *Value) bool {
8768 // match: (Eq16 x y)
8769 // result: (SETEQ (CMPW x y))
8774 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8780 func rewriteValue386_OpEq32(v *Value) bool {
8784 // match: (Eq32 x y)
8785 // result: (SETEQ (CMPL x y))
8790 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8796 func rewriteValue386_OpEq32F(v *Value) bool {
8800 // match: (Eq32F x y)
8801 // result: (SETEQF (UCOMISS x y))
8805 v.reset(Op386SETEQF)
8806 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8812 func rewriteValue386_OpEq64F(v *Value) bool {
8816 // match: (Eq64F x y)
8817 // result: (SETEQF (UCOMISD x y))
8821 v.reset(Op386SETEQF)
8822 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
8828 func rewriteValue386_OpEq8(v *Value) bool {
8833 // result: (SETEQ (CMPB x y))
8838 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8844 func rewriteValue386_OpEqB(v *Value) bool {
8849 // result: (SETEQ (CMPB x y))
8854 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8860 func rewriteValue386_OpEqPtr(v *Value) bool {
8864 // match: (EqPtr x y)
8865 // result: (SETEQ (CMPL x y))
8870 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8876 func rewriteValue386_OpIsInBounds(v *Value) bool {
8880 // match: (IsInBounds idx len)
8881 // result: (SETB (CMPL idx len))
8886 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8887 v0.AddArg2(idx, len)
8892 func rewriteValue386_OpIsNonNil(v *Value) bool {
8895 // match: (IsNonNil p)
8896 // result: (SETNE (TESTL p p))
8900 v0 := b.NewValue0(v.Pos, Op386TESTL, types.TypeFlags)
8906 func rewriteValue386_OpIsSliceInBounds(v *Value) bool {
8910 // match: (IsSliceInBounds idx len)
8911 // result: (SETBE (CMPL idx len))
8916 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8917 v0.AddArg2(idx, len)
8922 func rewriteValue386_OpLeq16(v *Value) bool {
8926 // match: (Leq16 x y)
8927 // result: (SETLE (CMPW x y))
8932 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8938 func rewriteValue386_OpLeq16U(v *Value) bool {
8942 // match: (Leq16U x y)
8943 // result: (SETBE (CMPW x y))
8948 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8954 func rewriteValue386_OpLeq32(v *Value) bool {
8958 // match: (Leq32 x y)
8959 // result: (SETLE (CMPL x y))
8964 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8970 func rewriteValue386_OpLeq32F(v *Value) bool {
8974 // match: (Leq32F x y)
8975 // result: (SETGEF (UCOMISS y x))
8979 v.reset(Op386SETGEF)
8980 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8986 func rewriteValue386_OpLeq32U(v *Value) bool {
8990 // match: (Leq32U x y)
8991 // result: (SETBE (CMPL x y))
8996 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9002 func rewriteValue386_OpLeq64F(v *Value) bool {
9006 // match: (Leq64F x y)
9007 // result: (SETGEF (UCOMISD y x))
9011 v.reset(Op386SETGEF)
9012 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
9018 func rewriteValue386_OpLeq8(v *Value) bool {
9022 // match: (Leq8 x y)
9023 // result: (SETLE (CMPB x y))
9028 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9034 func rewriteValue386_OpLeq8U(v *Value) bool {
9038 // match: (Leq8U x y)
9039 // result: (SETBE (CMPB x y))
9044 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9050 func rewriteValue386_OpLess16(v *Value) bool {
9054 // match: (Less16 x y)
9055 // result: (SETL (CMPW x y))
9060 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
9066 func rewriteValue386_OpLess16U(v *Value) bool {
9070 // match: (Less16U x y)
9071 // result: (SETB (CMPW x y))
9076 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
9082 func rewriteValue386_OpLess32(v *Value) bool {
9086 // match: (Less32 x y)
9087 // result: (SETL (CMPL x y))
9092 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9098 func rewriteValue386_OpLess32F(v *Value) bool {
9102 // match: (Less32F x y)
9103 // result: (SETGF (UCOMISS y x))
9108 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
9114 func rewriteValue386_OpLess32U(v *Value) bool {
9118 // match: (Less32U x y)
9119 // result: (SETB (CMPL x y))
9124 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9130 func rewriteValue386_OpLess64F(v *Value) bool {
9134 // match: (Less64F x y)
9135 // result: (SETGF (UCOMISD y x))
9140 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
9146 func rewriteValue386_OpLess8(v *Value) bool {
9150 // match: (Less8 x y)
9151 // result: (SETL (CMPB x y))
9156 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9162 func rewriteValue386_OpLess8U(v *Value) bool {
9166 // match: (Less8U x y)
9167 // result: (SETB (CMPB x y))
9172 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9178 func rewriteValue386_OpLoad(v *Value) bool {
9181 // match: (Load <t> ptr mem)
9182 // cond: (is32BitInt(t) || isPtr(t))
9183 // result: (MOVLload ptr mem)
9188 if !(is32BitInt(t) || isPtr(t)) {
9191 v.reset(Op386MOVLload)
9195 // match: (Load <t> ptr mem)
9196 // cond: is16BitInt(t)
9197 // result: (MOVWload ptr mem)
9202 if !(is16BitInt(t)) {
9205 v.reset(Op386MOVWload)
9209 // match: (Load <t> ptr mem)
9210 // cond: (t.IsBoolean() || is8BitInt(t))
9211 // result: (MOVBload ptr mem)
9216 if !(t.IsBoolean() || is8BitInt(t)) {
9219 v.reset(Op386MOVBload)
9223 // match: (Load <t> ptr mem)
9224 // cond: is32BitFloat(t)
9225 // result: (MOVSSload ptr mem)
9230 if !(is32BitFloat(t)) {
9233 v.reset(Op386MOVSSload)
9237 // match: (Load <t> ptr mem)
9238 // cond: is64BitFloat(t)
9239 // result: (MOVSDload ptr mem)
9244 if !(is64BitFloat(t)) {
9247 v.reset(Op386MOVSDload)
9253 func rewriteValue386_OpLocalAddr(v *Value) bool {
9255 // match: (LocalAddr {sym} base _)
9256 // result: (LEAL {sym} base)
9258 sym := auxToSym(v.Aux)
9261 v.Aux = symToAux(sym)
9266 func rewriteValue386_OpLsh16x16(v *Value) bool {
9270 // match: (Lsh16x16 <t> x y)
9271 // cond: !shiftIsBounded(v)
9272 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9277 if !(!shiftIsBounded(v)) {
9281 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9283 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9284 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9285 v2.AuxInt = int16ToAuxInt(32)
9291 // match: (Lsh16x16 <t> x y)
9292 // cond: shiftIsBounded(v)
9293 // result: (SHLL <t> x y)
9298 if !(shiftIsBounded(v)) {
9308 func rewriteValue386_OpLsh16x32(v *Value) bool {
9312 // match: (Lsh16x32 <t> x y)
9313 // cond: !shiftIsBounded(v)
9314 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9319 if !(!shiftIsBounded(v)) {
9323 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9325 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9326 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9327 v2.AuxInt = int32ToAuxInt(32)
9333 // match: (Lsh16x32 <t> x y)
9334 // cond: shiftIsBounded(v)
9335 // result: (SHLL <t> x y)
9340 if !(shiftIsBounded(v)) {
9350 func rewriteValue386_OpLsh16x64(v *Value) bool {
9353 // match: (Lsh16x64 x (Const64 [c]))
9354 // cond: uint64(c) < 16
9355 // result: (SHLLconst x [int32(c)])
9358 if v_1.Op != OpConst64 {
9361 c := auxIntToInt64(v_1.AuxInt)
9362 if !(uint64(c) < 16) {
9365 v.reset(Op386SHLLconst)
9366 v.AuxInt = int32ToAuxInt(int32(c))
9370 // match: (Lsh16x64 _ (Const64 [c]))
9371 // cond: uint64(c) >= 16
9372 // result: (Const16 [0])
9374 if v_1.Op != OpConst64 {
9377 c := auxIntToInt64(v_1.AuxInt)
9378 if !(uint64(c) >= 16) {
9382 v.AuxInt = int16ToAuxInt(0)
9387 func rewriteValue386_OpLsh16x8(v *Value) bool {
9391 // match: (Lsh16x8 <t> x y)
9392 // cond: !shiftIsBounded(v)
9393 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9398 if !(!shiftIsBounded(v)) {
9402 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9404 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9405 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9406 v2.AuxInt = int8ToAuxInt(32)
9412 // match: (Lsh16x8 <t> x y)
9413 // cond: shiftIsBounded(v)
9414 // result: (SHLL <t> x y)
9419 if !(shiftIsBounded(v)) {
9429 func rewriteValue386_OpLsh32x16(v *Value) bool {
9433 // match: (Lsh32x16 <t> x y)
9434 // cond: !shiftIsBounded(v)
9435 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9440 if !(!shiftIsBounded(v)) {
9444 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9446 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9447 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9448 v2.AuxInt = int16ToAuxInt(32)
9454 // match: (Lsh32x16 <t> x y)
9455 // cond: shiftIsBounded(v)
9456 // result: (SHLL <t> x y)
9461 if !(shiftIsBounded(v)) {
9471 func rewriteValue386_OpLsh32x32(v *Value) bool {
9475 // match: (Lsh32x32 <t> x y)
9476 // cond: !shiftIsBounded(v)
9477 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9482 if !(!shiftIsBounded(v)) {
9486 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9488 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9489 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9490 v2.AuxInt = int32ToAuxInt(32)
9496 // match: (Lsh32x32 <t> x y)
9497 // cond: shiftIsBounded(v)
9498 // result: (SHLL <t> x y)
9503 if !(shiftIsBounded(v)) {
9513 func rewriteValue386_OpLsh32x64(v *Value) bool {
9516 // match: (Lsh32x64 x (Const64 [c]))
9517 // cond: uint64(c) < 32
9518 // result: (SHLLconst x [int32(c)])
9521 if v_1.Op != OpConst64 {
9524 c := auxIntToInt64(v_1.AuxInt)
9525 if !(uint64(c) < 32) {
9528 v.reset(Op386SHLLconst)
9529 v.AuxInt = int32ToAuxInt(int32(c))
9533 // match: (Lsh32x64 _ (Const64 [c]))
9534 // cond: uint64(c) >= 32
9535 // result: (Const32 [0])
9537 if v_1.Op != OpConst64 {
9540 c := auxIntToInt64(v_1.AuxInt)
9541 if !(uint64(c) >= 32) {
9545 v.AuxInt = int32ToAuxInt(0)
9550 func rewriteValue386_OpLsh32x8(v *Value) bool {
9554 // match: (Lsh32x8 <t> x y)
9555 // cond: !shiftIsBounded(v)
9556 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9561 if !(!shiftIsBounded(v)) {
9565 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9567 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9568 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9569 v2.AuxInt = int8ToAuxInt(32)
9575 // match: (Lsh32x8 <t> x y)
9576 // cond: shiftIsBounded(v)
9577 // result: (SHLL <t> x y)
9582 if !(shiftIsBounded(v)) {
9592 func rewriteValue386_OpLsh8x16(v *Value) bool {
9596 // match: (Lsh8x16 <t> x y)
9597 // cond: !shiftIsBounded(v)
9598 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9603 if !(!shiftIsBounded(v)) {
9607 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9609 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9610 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9611 v2.AuxInt = int16ToAuxInt(32)
9617 // match: (Lsh8x16 <t> x y)
9618 // cond: shiftIsBounded(v)
9619 // result: (SHLL <t> x y)
9624 if !(shiftIsBounded(v)) {
9634 func rewriteValue386_OpLsh8x32(v *Value) bool {
9638 // match: (Lsh8x32 <t> x y)
9639 // cond: !shiftIsBounded(v)
9640 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9645 if !(!shiftIsBounded(v)) {
9649 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9651 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9652 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9653 v2.AuxInt = int32ToAuxInt(32)
9659 // match: (Lsh8x32 <t> x y)
9660 // cond: shiftIsBounded(v)
9661 // result: (SHLL <t> x y)
9666 if !(shiftIsBounded(v)) {
9676 func rewriteValue386_OpLsh8x64(v *Value) bool {
9679 // match: (Lsh8x64 x (Const64 [c]))
9680 // cond: uint64(c) < 8
9681 // result: (SHLLconst x [int32(c)])
9684 if v_1.Op != OpConst64 {
9687 c := auxIntToInt64(v_1.AuxInt)
9688 if !(uint64(c) < 8) {
9691 v.reset(Op386SHLLconst)
9692 v.AuxInt = int32ToAuxInt(int32(c))
9696 // match: (Lsh8x64 _ (Const64 [c]))
9697 // cond: uint64(c) >= 8
9698 // result: (Const8 [0])
9700 if v_1.Op != OpConst64 {
9703 c := auxIntToInt64(v_1.AuxInt)
9704 if !(uint64(c) >= 8) {
9708 v.AuxInt = int8ToAuxInt(0)
9713 func rewriteValue386_OpLsh8x8(v *Value) bool {
9717 // match: (Lsh8x8 <t> x y)
9718 // cond: !shiftIsBounded(v)
9719 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9724 if !(!shiftIsBounded(v)) {
9728 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9730 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9731 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9732 v2.AuxInt = int8ToAuxInt(32)
9738 // match: (Lsh8x8 <t> x y)
9739 // cond: shiftIsBounded(v)
9740 // result: (SHLL <t> x y)
9745 if !(shiftIsBounded(v)) {
9755 func rewriteValue386_OpMod8(v *Value) bool {
9759 typ := &b.Func.Config.Types
9760 // match: (Mod8 x y)
9761 // result: (MODW (SignExt8to16 x) (SignExt8to16 y))
9766 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
9768 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
9774 func rewriteValue386_OpMod8u(v *Value) bool {
9778 typ := &b.Func.Config.Types
9779 // match: (Mod8u x y)
9780 // result: (MODWU (ZeroExt8to16 x) (ZeroExt8to16 y))
9785 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
9787 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
9793 func rewriteValue386_OpMove(v *Value) bool {
9798 config := b.Func.Config
9799 typ := &b.Func.Config.Types
9800 // match: (Move [0] _ _ mem)
9803 if auxIntToInt64(v.AuxInt) != 0 {
9810 // match: (Move [1] dst src mem)
9811 // result: (MOVBstore dst (MOVBload src mem) mem)
9813 if auxIntToInt64(v.AuxInt) != 1 {
9819 v.reset(Op386MOVBstore)
9820 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9821 v0.AddArg2(src, mem)
9822 v.AddArg3(dst, v0, mem)
9825 // match: (Move [2] dst src mem)
9826 // result: (MOVWstore dst (MOVWload src mem) mem)
9828 if auxIntToInt64(v.AuxInt) != 2 {
9834 v.reset(Op386MOVWstore)
9835 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9836 v0.AddArg2(src, mem)
9837 v.AddArg3(dst, v0, mem)
9840 // match: (Move [4] dst src mem)
9841 // result: (MOVLstore dst (MOVLload src mem) mem)
9843 if auxIntToInt64(v.AuxInt) != 4 {
9849 v.reset(Op386MOVLstore)
9850 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9851 v0.AddArg2(src, mem)
9852 v.AddArg3(dst, v0, mem)
9855 // match: (Move [3] dst src mem)
9856 // result: (MOVBstore [2] dst (MOVBload [2] src mem) (MOVWstore dst (MOVWload src mem) mem))
9858 if auxIntToInt64(v.AuxInt) != 3 {
9864 v.reset(Op386MOVBstore)
9865 v.AuxInt = int32ToAuxInt(2)
9866 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9867 v0.AuxInt = int32ToAuxInt(2)
9868 v0.AddArg2(src, mem)
9869 v1 := b.NewValue0(v.Pos, Op386MOVWstore, types.TypeMem)
9870 v2 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9871 v2.AddArg2(src, mem)
9872 v1.AddArg3(dst, v2, mem)
9873 v.AddArg3(dst, v0, v1)
9876 // match: (Move [5] dst src mem)
9877 // result: (MOVBstore [4] dst (MOVBload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9879 if auxIntToInt64(v.AuxInt) != 5 {
9885 v.reset(Op386MOVBstore)
9886 v.AuxInt = int32ToAuxInt(4)
9887 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9888 v0.AuxInt = int32ToAuxInt(4)
9889 v0.AddArg2(src, mem)
9890 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9891 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9892 v2.AddArg2(src, mem)
9893 v1.AddArg3(dst, v2, mem)
9894 v.AddArg3(dst, v0, v1)
9897 // match: (Move [6] dst src mem)
9898 // result: (MOVWstore [4] dst (MOVWload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9900 if auxIntToInt64(v.AuxInt) != 6 {
9906 v.reset(Op386MOVWstore)
9907 v.AuxInt = int32ToAuxInt(4)
9908 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9909 v0.AuxInt = int32ToAuxInt(4)
9910 v0.AddArg2(src, mem)
9911 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9912 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9913 v2.AddArg2(src, mem)
9914 v1.AddArg3(dst, v2, mem)
9915 v.AddArg3(dst, v0, v1)
9918 // match: (Move [7] dst src mem)
9919 // result: (MOVLstore [3] dst (MOVLload [3] src mem) (MOVLstore dst (MOVLload src mem) mem))
9921 if auxIntToInt64(v.AuxInt) != 7 {
9927 v.reset(Op386MOVLstore)
9928 v.AuxInt = int32ToAuxInt(3)
9929 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9930 v0.AuxInt = int32ToAuxInt(3)
9931 v0.AddArg2(src, mem)
9932 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9933 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9934 v2.AddArg2(src, mem)
9935 v1.AddArg3(dst, v2, mem)
9936 v.AddArg3(dst, v0, v1)
9939 // match: (Move [8] dst src mem)
9940 // result: (MOVLstore [4] dst (MOVLload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9942 if auxIntToInt64(v.AuxInt) != 8 {
9948 v.reset(Op386MOVLstore)
9949 v.AuxInt = int32ToAuxInt(4)
9950 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9951 v0.AuxInt = int32ToAuxInt(4)
9952 v0.AddArg2(src, mem)
9953 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9954 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9955 v2.AddArg2(src, mem)
9956 v1.AddArg3(dst, v2, mem)
9957 v.AddArg3(dst, v0, v1)
9960 // match: (Move [s] dst src mem)
9961 // cond: s > 8 && s%4 != 0
9962 // 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))
9964 s := auxIntToInt64(v.AuxInt)
9968 if !(s > 8 && s%4 != 0) {
9972 v.AuxInt = int64ToAuxInt(s - s%4)
9973 v0 := b.NewValue0(v.Pos, Op386ADDLconst, dst.Type)
9974 v0.AuxInt = int32ToAuxInt(int32(s % 4))
9976 v1 := b.NewValue0(v.Pos, Op386ADDLconst, src.Type)
9977 v1.AuxInt = int32ToAuxInt(int32(s % 4))
9979 v2 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9980 v3 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9981 v3.AddArg2(src, mem)
9982 v2.AddArg3(dst, v3, mem)
9983 v.AddArg3(v0, v1, v2)
9986 // match: (Move [s] dst src mem)
9987 // cond: s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
9988 // result: (DUFFCOPY [10*(128-s/4)] dst src mem)
9990 s := auxIntToInt64(v.AuxInt)
9994 if !(s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
9997 v.reset(Op386DUFFCOPY)
9998 v.AuxInt = int64ToAuxInt(10 * (128 - s/4))
9999 v.AddArg3(dst, src, mem)
10002 // match: (Move [s] dst src mem)
10003 // cond: (s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)
10004 // result: (REPMOVSL dst src (MOVLconst [int32(s/4)]) mem)
10006 s := auxIntToInt64(v.AuxInt)
10010 if !((s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)) {
10013 v.reset(Op386REPMOVSL)
10014 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
10015 v0.AuxInt = int32ToAuxInt(int32(s / 4))
10016 v.AddArg4(dst, src, v0, mem)
10021 func rewriteValue386_OpNeg32F(v *Value) bool {
10024 typ := &b.Func.Config.Types
10025 // match: (Neg32F x)
10026 // result: (PXOR x (MOVSSconst <typ.Float32> [float32(math.Copysign(0, -1))]))
10030 v0 := b.NewValue0(v.Pos, Op386MOVSSconst, typ.Float32)
10031 v0.AuxInt = float32ToAuxInt(float32(math.Copysign(0, -1)))
10036 func rewriteValue386_OpNeg64F(v *Value) bool {
10039 typ := &b.Func.Config.Types
10040 // match: (Neg64F x)
10041 // result: (PXOR x (MOVSDconst <typ.Float64> [math.Copysign(0, -1)]))
10045 v0 := b.NewValue0(v.Pos, Op386MOVSDconst, typ.Float64)
10046 v0.AuxInt = float64ToAuxInt(math.Copysign(0, -1))
10051 func rewriteValue386_OpNeq16(v *Value) bool {
10055 // match: (Neq16 x y)
10056 // result: (SETNE (CMPW x y))
10060 v.reset(Op386SETNE)
10061 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
10067 func rewriteValue386_OpNeq32(v *Value) bool {
10071 // match: (Neq32 x y)
10072 // result: (SETNE (CMPL x y))
10076 v.reset(Op386SETNE)
10077 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
10083 func rewriteValue386_OpNeq32F(v *Value) bool {
10087 // match: (Neq32F x y)
10088 // result: (SETNEF (UCOMISS x y))
10092 v.reset(Op386SETNEF)
10093 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
10099 func rewriteValue386_OpNeq64F(v *Value) bool {
10103 // match: (Neq64F x y)
10104 // result: (SETNEF (UCOMISD x y))
10108 v.reset(Op386SETNEF)
10109 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
10115 func rewriteValue386_OpNeq8(v *Value) bool {
10119 // match: (Neq8 x y)
10120 // result: (SETNE (CMPB x y))
10124 v.reset(Op386SETNE)
10125 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
10131 func rewriteValue386_OpNeqB(v *Value) bool {
10135 // match: (NeqB x y)
10136 // result: (SETNE (CMPB x y))
10140 v.reset(Op386SETNE)
10141 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
10147 func rewriteValue386_OpNeqPtr(v *Value) bool {
10151 // match: (NeqPtr x y)
10152 // result: (SETNE (CMPL x y))
10156 v.reset(Op386SETNE)
10157 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
10163 func rewriteValue386_OpNot(v *Value) bool {
10166 // result: (XORLconst [1] x)
10169 v.reset(Op386XORLconst)
10170 v.AuxInt = int32ToAuxInt(1)
10175 func rewriteValue386_OpOffPtr(v *Value) bool {
10177 // match: (OffPtr [off] ptr)
10178 // result: (ADDLconst [int32(off)] ptr)
10180 off := auxIntToInt64(v.AuxInt)
10182 v.reset(Op386ADDLconst)
10183 v.AuxInt = int32ToAuxInt(int32(off))
10188 func rewriteValue386_OpPanicBounds(v *Value) bool {
10192 // match: (PanicBounds [kind] x y mem)
10193 // cond: boundsABI(kind) == 0
10194 // result: (LoweredPanicBoundsA [kind] x y mem)
10196 kind := auxIntToInt64(v.AuxInt)
10200 if !(boundsABI(kind) == 0) {
10203 v.reset(Op386LoweredPanicBoundsA)
10204 v.AuxInt = int64ToAuxInt(kind)
10205 v.AddArg3(x, y, mem)
10208 // match: (PanicBounds [kind] x y mem)
10209 // cond: boundsABI(kind) == 1
10210 // result: (LoweredPanicBoundsB [kind] x y mem)
10212 kind := auxIntToInt64(v.AuxInt)
10216 if !(boundsABI(kind) == 1) {
10219 v.reset(Op386LoweredPanicBoundsB)
10220 v.AuxInt = int64ToAuxInt(kind)
10221 v.AddArg3(x, y, mem)
10224 // match: (PanicBounds [kind] x y mem)
10225 // cond: boundsABI(kind) == 2
10226 // result: (LoweredPanicBoundsC [kind] x y mem)
10228 kind := auxIntToInt64(v.AuxInt)
10232 if !(boundsABI(kind) == 2) {
10235 v.reset(Op386LoweredPanicBoundsC)
10236 v.AuxInt = int64ToAuxInt(kind)
10237 v.AddArg3(x, y, mem)
10242 func rewriteValue386_OpPanicExtend(v *Value) bool {
10247 // match: (PanicExtend [kind] hi lo y mem)
10248 // cond: boundsABI(kind) == 0
10249 // result: (LoweredPanicExtendA [kind] hi lo y mem)
10251 kind := auxIntToInt64(v.AuxInt)
10256 if !(boundsABI(kind) == 0) {
10259 v.reset(Op386LoweredPanicExtendA)
10260 v.AuxInt = int64ToAuxInt(kind)
10261 v.AddArg4(hi, lo, y, mem)
10264 // match: (PanicExtend [kind] hi lo y mem)
10265 // cond: boundsABI(kind) == 1
10266 // result: (LoweredPanicExtendB [kind] hi lo y mem)
10268 kind := auxIntToInt64(v.AuxInt)
10273 if !(boundsABI(kind) == 1) {
10276 v.reset(Op386LoweredPanicExtendB)
10277 v.AuxInt = int64ToAuxInt(kind)
10278 v.AddArg4(hi, lo, y, mem)
10281 // match: (PanicExtend [kind] hi lo y mem)
10282 // cond: boundsABI(kind) == 2
10283 // result: (LoweredPanicExtendC [kind] hi lo y mem)
10285 kind := auxIntToInt64(v.AuxInt)
10290 if !(boundsABI(kind) == 2) {
10293 v.reset(Op386LoweredPanicExtendC)
10294 v.AuxInt = int64ToAuxInt(kind)
10295 v.AddArg4(hi, lo, y, mem)
10300 func rewriteValue386_OpRotateLeft16(v *Value) bool {
10303 // match: (RotateLeft16 x (MOVLconst [c]))
10304 // result: (ROLWconst [int16(c&15)] x)
10307 if v_1.Op != Op386MOVLconst {
10310 c := auxIntToInt32(v_1.AuxInt)
10311 v.reset(Op386ROLWconst)
10312 v.AuxInt = int16ToAuxInt(int16(c & 15))
10318 func rewriteValue386_OpRotateLeft32(v *Value) bool {
10321 // match: (RotateLeft32 x (MOVLconst [c]))
10322 // result: (ROLLconst [c&31] x)
10325 if v_1.Op != Op386MOVLconst {
10328 c := auxIntToInt32(v_1.AuxInt)
10329 v.reset(Op386ROLLconst)
10330 v.AuxInt = int32ToAuxInt(c & 31)
10336 func rewriteValue386_OpRotateLeft8(v *Value) bool {
10339 // match: (RotateLeft8 x (MOVLconst [c]))
10340 // result: (ROLBconst [int8(c&7)] x)
10343 if v_1.Op != Op386MOVLconst {
10346 c := auxIntToInt32(v_1.AuxInt)
10347 v.reset(Op386ROLBconst)
10348 v.AuxInt = int8ToAuxInt(int8(c & 7))
10354 func rewriteValue386_OpRsh16Ux16(v *Value) bool {
10358 // match: (Rsh16Ux16 <t> x y)
10359 // cond: !shiftIsBounded(v)
10360 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPWconst y [16])))
10365 if !(!shiftIsBounded(v)) {
10369 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10371 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10372 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10373 v2.AuxInt = int16ToAuxInt(16)
10379 // match: (Rsh16Ux16 <t> x y)
10380 // cond: shiftIsBounded(v)
10381 // result: (SHRW <t> x y)
10386 if !(shiftIsBounded(v)) {
10396 func rewriteValue386_OpRsh16Ux32(v *Value) bool {
10400 // match: (Rsh16Ux32 <t> x y)
10401 // cond: !shiftIsBounded(v)
10402 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPLconst y [16])))
10407 if !(!shiftIsBounded(v)) {
10411 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10413 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10414 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10415 v2.AuxInt = int32ToAuxInt(16)
10421 // match: (Rsh16Ux32 <t> x y)
10422 // cond: shiftIsBounded(v)
10423 // result: (SHRW <t> x y)
10428 if !(shiftIsBounded(v)) {
10438 func rewriteValue386_OpRsh16Ux64(v *Value) bool {
10441 // match: (Rsh16Ux64 x (Const64 [c]))
10442 // cond: uint64(c) < 16
10443 // result: (SHRWconst x [int16(c)])
10446 if v_1.Op != OpConst64 {
10449 c := auxIntToInt64(v_1.AuxInt)
10450 if !(uint64(c) < 16) {
10453 v.reset(Op386SHRWconst)
10454 v.AuxInt = int16ToAuxInt(int16(c))
10458 // match: (Rsh16Ux64 _ (Const64 [c]))
10459 // cond: uint64(c) >= 16
10460 // result: (Const16 [0])
10462 if v_1.Op != OpConst64 {
10465 c := auxIntToInt64(v_1.AuxInt)
10466 if !(uint64(c) >= 16) {
10470 v.AuxInt = int16ToAuxInt(0)
10475 func rewriteValue386_OpRsh16Ux8(v *Value) bool {
10479 // match: (Rsh16Ux8 <t> x y)
10480 // cond: !shiftIsBounded(v)
10481 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPBconst y [16])))
10486 if !(!shiftIsBounded(v)) {
10490 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10492 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10493 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10494 v2.AuxInt = int8ToAuxInt(16)
10500 // match: (Rsh16Ux8 <t> x y)
10501 // cond: shiftIsBounded(v)
10502 // result: (SHRW <t> x y)
10507 if !(shiftIsBounded(v)) {
10517 func rewriteValue386_OpRsh16x16(v *Value) bool {
10521 // match: (Rsh16x16 <t> x y)
10522 // cond: !shiftIsBounded(v)
10523 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [16])))))
10528 if !(!shiftIsBounded(v)) {
10533 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10534 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10535 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10536 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10537 v3.AuxInt = int16ToAuxInt(16)
10545 // match: (Rsh16x16 <t> x y)
10546 // cond: shiftIsBounded(v)
10547 // result: (SARW x y)
10551 if !(shiftIsBounded(v)) {
10560 func rewriteValue386_OpRsh16x32(v *Value) bool {
10564 // match: (Rsh16x32 <t> x y)
10565 // cond: !shiftIsBounded(v)
10566 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [16])))))
10571 if !(!shiftIsBounded(v)) {
10576 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10577 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10578 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10579 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10580 v3.AuxInt = int32ToAuxInt(16)
10588 // match: (Rsh16x32 <t> x y)
10589 // cond: shiftIsBounded(v)
10590 // result: (SARW x y)
10594 if !(shiftIsBounded(v)) {
10603 func rewriteValue386_OpRsh16x64(v *Value) bool {
10606 // match: (Rsh16x64 x (Const64 [c]))
10607 // cond: uint64(c) < 16
10608 // result: (SARWconst x [int16(c)])
10611 if v_1.Op != OpConst64 {
10614 c := auxIntToInt64(v_1.AuxInt)
10615 if !(uint64(c) < 16) {
10618 v.reset(Op386SARWconst)
10619 v.AuxInt = int16ToAuxInt(int16(c))
10623 // match: (Rsh16x64 x (Const64 [c]))
10624 // cond: uint64(c) >= 16
10625 // result: (SARWconst x [15])
10628 if v_1.Op != OpConst64 {
10631 c := auxIntToInt64(v_1.AuxInt)
10632 if !(uint64(c) >= 16) {
10635 v.reset(Op386SARWconst)
10636 v.AuxInt = int16ToAuxInt(15)
10642 func rewriteValue386_OpRsh16x8(v *Value) bool {
10646 // match: (Rsh16x8 <t> x y)
10647 // cond: !shiftIsBounded(v)
10648 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [16])))))
10653 if !(!shiftIsBounded(v)) {
10658 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10659 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10660 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10661 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10662 v3.AuxInt = int8ToAuxInt(16)
10670 // match: (Rsh16x8 <t> x y)
10671 // cond: shiftIsBounded(v)
10672 // result: (SARW x y)
10676 if !(shiftIsBounded(v)) {
10685 func rewriteValue386_OpRsh32Ux16(v *Value) bool {
10689 // match: (Rsh32Ux16 <t> x y)
10690 // cond: !shiftIsBounded(v)
10691 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
10696 if !(!shiftIsBounded(v)) {
10700 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10702 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10703 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10704 v2.AuxInt = int16ToAuxInt(32)
10710 // match: (Rsh32Ux16 <t> x y)
10711 // cond: shiftIsBounded(v)
10712 // result: (SHRL <t> x y)
10717 if !(shiftIsBounded(v)) {
10727 func rewriteValue386_OpRsh32Ux32(v *Value) bool {
10731 // match: (Rsh32Ux32 <t> x y)
10732 // cond: !shiftIsBounded(v)
10733 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
10738 if !(!shiftIsBounded(v)) {
10742 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10744 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10745 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10746 v2.AuxInt = int32ToAuxInt(32)
10752 // match: (Rsh32Ux32 <t> x y)
10753 // cond: shiftIsBounded(v)
10754 // result: (SHRL <t> x y)
10759 if !(shiftIsBounded(v)) {
10769 func rewriteValue386_OpRsh32Ux64(v *Value) bool {
10772 // match: (Rsh32Ux64 x (Const64 [c]))
10773 // cond: uint64(c) < 32
10774 // result: (SHRLconst x [int32(c)])
10777 if v_1.Op != OpConst64 {
10780 c := auxIntToInt64(v_1.AuxInt)
10781 if !(uint64(c) < 32) {
10784 v.reset(Op386SHRLconst)
10785 v.AuxInt = int32ToAuxInt(int32(c))
10789 // match: (Rsh32Ux64 _ (Const64 [c]))
10790 // cond: uint64(c) >= 32
10791 // result: (Const32 [0])
10793 if v_1.Op != OpConst64 {
10796 c := auxIntToInt64(v_1.AuxInt)
10797 if !(uint64(c) >= 32) {
10801 v.AuxInt = int32ToAuxInt(0)
10806 func rewriteValue386_OpRsh32Ux8(v *Value) bool {
10810 // match: (Rsh32Ux8 <t> x y)
10811 // cond: !shiftIsBounded(v)
10812 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
10817 if !(!shiftIsBounded(v)) {
10821 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10823 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10824 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10825 v2.AuxInt = int8ToAuxInt(32)
10831 // match: (Rsh32Ux8 <t> x y)
10832 // cond: shiftIsBounded(v)
10833 // result: (SHRL <t> x y)
10838 if !(shiftIsBounded(v)) {
10848 func rewriteValue386_OpRsh32x16(v *Value) bool {
10852 // match: (Rsh32x16 <t> x y)
10853 // cond: !shiftIsBounded(v)
10854 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [32])))))
10859 if !(!shiftIsBounded(v)) {
10864 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10865 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10866 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10867 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10868 v3.AuxInt = int16ToAuxInt(32)
10876 // match: (Rsh32x16 <t> x y)
10877 // cond: shiftIsBounded(v)
10878 // result: (SARL x y)
10882 if !(shiftIsBounded(v)) {
10891 func rewriteValue386_OpRsh32x32(v *Value) bool {
10895 // match: (Rsh32x32 <t> x y)
10896 // cond: !shiftIsBounded(v)
10897 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [32])))))
10902 if !(!shiftIsBounded(v)) {
10907 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10908 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10909 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10910 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10911 v3.AuxInt = int32ToAuxInt(32)
10919 // match: (Rsh32x32 <t> x y)
10920 // cond: shiftIsBounded(v)
10921 // result: (SARL x y)
10925 if !(shiftIsBounded(v)) {
10934 func rewriteValue386_OpRsh32x64(v *Value) bool {
10937 // match: (Rsh32x64 x (Const64 [c]))
10938 // cond: uint64(c) < 32
10939 // result: (SARLconst x [int32(c)])
10942 if v_1.Op != OpConst64 {
10945 c := auxIntToInt64(v_1.AuxInt)
10946 if !(uint64(c) < 32) {
10949 v.reset(Op386SARLconst)
10950 v.AuxInt = int32ToAuxInt(int32(c))
10954 // match: (Rsh32x64 x (Const64 [c]))
10955 // cond: uint64(c) >= 32
10956 // result: (SARLconst x [31])
10959 if v_1.Op != OpConst64 {
10962 c := auxIntToInt64(v_1.AuxInt)
10963 if !(uint64(c) >= 32) {
10966 v.reset(Op386SARLconst)
10967 v.AuxInt = int32ToAuxInt(31)
10973 func rewriteValue386_OpRsh32x8(v *Value) bool {
10977 // match: (Rsh32x8 <t> x y)
10978 // cond: !shiftIsBounded(v)
10979 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [32])))))
10984 if !(!shiftIsBounded(v)) {
10989 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10990 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10991 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10992 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10993 v3.AuxInt = int8ToAuxInt(32)
11001 // match: (Rsh32x8 <t> x y)
11002 // cond: shiftIsBounded(v)
11003 // result: (SARL x y)
11007 if !(shiftIsBounded(v)) {
11016 func rewriteValue386_OpRsh8Ux16(v *Value) bool {
11020 // match: (Rsh8Ux16 <t> x y)
11021 // cond: !shiftIsBounded(v)
11022 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPWconst y [8])))
11027 if !(!shiftIsBounded(v)) {
11031 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11033 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11034 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
11035 v2.AuxInt = int16ToAuxInt(8)
11041 // match: (Rsh8Ux16 <t> x y)
11042 // cond: shiftIsBounded(v)
11043 // result: (SHRB <t> x y)
11048 if !(shiftIsBounded(v)) {
11058 func rewriteValue386_OpRsh8Ux32(v *Value) bool {
11062 // match: (Rsh8Ux32 <t> x y)
11063 // cond: !shiftIsBounded(v)
11064 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPLconst y [8])))
11069 if !(!shiftIsBounded(v)) {
11073 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11075 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11076 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11077 v2.AuxInt = int32ToAuxInt(8)
11083 // match: (Rsh8Ux32 <t> x y)
11084 // cond: shiftIsBounded(v)
11085 // result: (SHRB <t> x y)
11090 if !(shiftIsBounded(v)) {
11100 func rewriteValue386_OpRsh8Ux64(v *Value) bool {
11103 // match: (Rsh8Ux64 x (Const64 [c]))
11104 // cond: uint64(c) < 8
11105 // result: (SHRBconst x [int8(c)])
11108 if v_1.Op != OpConst64 {
11111 c := auxIntToInt64(v_1.AuxInt)
11112 if !(uint64(c) < 8) {
11115 v.reset(Op386SHRBconst)
11116 v.AuxInt = int8ToAuxInt(int8(c))
11120 // match: (Rsh8Ux64 _ (Const64 [c]))
11121 // cond: uint64(c) >= 8
11122 // result: (Const8 [0])
11124 if v_1.Op != OpConst64 {
11127 c := auxIntToInt64(v_1.AuxInt)
11128 if !(uint64(c) >= 8) {
11132 v.AuxInt = int8ToAuxInt(0)
11137 func rewriteValue386_OpRsh8Ux8(v *Value) bool {
11141 // match: (Rsh8Ux8 <t> x y)
11142 // cond: !shiftIsBounded(v)
11143 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPBconst y [8])))
11148 if !(!shiftIsBounded(v)) {
11152 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11154 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11155 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
11156 v2.AuxInt = int8ToAuxInt(8)
11162 // match: (Rsh8Ux8 <t> x y)
11163 // cond: shiftIsBounded(v)
11164 // result: (SHRB <t> x y)
11169 if !(shiftIsBounded(v)) {
11179 func rewriteValue386_OpRsh8x16(v *Value) bool {
11183 // match: (Rsh8x16 <t> x y)
11184 // cond: !shiftIsBounded(v)
11185 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [8])))))
11190 if !(!shiftIsBounded(v)) {
11195 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11196 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11197 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11198 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
11199 v3.AuxInt = int16ToAuxInt(8)
11207 // match: (Rsh8x16 <t> x y)
11208 // cond: shiftIsBounded(v)
11209 // result: (SARB x y)
11213 if !(shiftIsBounded(v)) {
11222 func rewriteValue386_OpRsh8x32(v *Value) bool {
11226 // match: (Rsh8x32 <t> x y)
11227 // cond: !shiftIsBounded(v)
11228 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [8])))))
11233 if !(!shiftIsBounded(v)) {
11238 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11239 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11240 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11241 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11242 v3.AuxInt = int32ToAuxInt(8)
11250 // match: (Rsh8x32 <t> x y)
11251 // cond: shiftIsBounded(v)
11252 // result: (SARB x y)
11256 if !(shiftIsBounded(v)) {
11265 func rewriteValue386_OpRsh8x64(v *Value) bool {
11268 // match: (Rsh8x64 x (Const64 [c]))
11269 // cond: uint64(c) < 8
11270 // result: (SARBconst x [int8(c)])
11273 if v_1.Op != OpConst64 {
11276 c := auxIntToInt64(v_1.AuxInt)
11277 if !(uint64(c) < 8) {
11280 v.reset(Op386SARBconst)
11281 v.AuxInt = int8ToAuxInt(int8(c))
11285 // match: (Rsh8x64 x (Const64 [c]))
11286 // cond: uint64(c) >= 8
11287 // result: (SARBconst x [7])
11290 if v_1.Op != OpConst64 {
11293 c := auxIntToInt64(v_1.AuxInt)
11294 if !(uint64(c) >= 8) {
11297 v.reset(Op386SARBconst)
11298 v.AuxInt = int8ToAuxInt(7)
11304 func rewriteValue386_OpRsh8x8(v *Value) bool {
11308 // match: (Rsh8x8 <t> x y)
11309 // cond: !shiftIsBounded(v)
11310 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [8])))))
11315 if !(!shiftIsBounded(v)) {
11320 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11321 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11322 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11323 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
11324 v3.AuxInt = int8ToAuxInt(8)
11332 // match: (Rsh8x8 <t> x y)
11333 // cond: shiftIsBounded(v)
11334 // result: (SARB x y)
11338 if !(shiftIsBounded(v)) {
11347 func rewriteValue386_OpSelect0(v *Value) bool {
11350 typ := &b.Func.Config.Types
11351 // match: (Select0 (Mul32uover x y))
11352 // result: (Select0 <typ.UInt32> (MULLU x y))
11354 if v_0.Op != OpMul32uover {
11360 v.Type = typ.UInt32
11361 v0 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
11368 func rewriteValue386_OpSelect1(v *Value) bool {
11371 typ := &b.Func.Config.Types
11372 // match: (Select1 (Mul32uover x y))
11373 // result: (SETO (Select1 <types.TypeFlags> (MULLU x y)))
11375 if v_0.Op != OpMul32uover {
11381 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11382 v1 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
11390 func rewriteValue386_OpSignmask(v *Value) bool {
11392 // match: (Signmask x)
11393 // result: (SARLconst x [31])
11396 v.reset(Op386SARLconst)
11397 v.AuxInt = int32ToAuxInt(31)
11402 func rewriteValue386_OpSlicemask(v *Value) bool {
11405 // match: (Slicemask <t> x)
11406 // result: (SARLconst (NEGL <t> x) [31])
11410 v.reset(Op386SARLconst)
11411 v.AuxInt = int32ToAuxInt(31)
11412 v0 := b.NewValue0(v.Pos, Op386NEGL, t)
11418 func rewriteValue386_OpStore(v *Value) bool {
11422 // match: (Store {t} ptr val mem)
11423 // cond: t.Size() == 8 && is64BitFloat(val.Type)
11424 // result: (MOVSDstore ptr val mem)
11426 t := auxToType(v.Aux)
11430 if !(t.Size() == 8 && is64BitFloat(val.Type)) {
11433 v.reset(Op386MOVSDstore)
11434 v.AddArg3(ptr, val, mem)
11437 // match: (Store {t} ptr val mem)
11438 // cond: t.Size() == 4 && is32BitFloat(val.Type)
11439 // result: (MOVSSstore ptr val mem)
11441 t := auxToType(v.Aux)
11445 if !(t.Size() == 4 && is32BitFloat(val.Type)) {
11448 v.reset(Op386MOVSSstore)
11449 v.AddArg3(ptr, val, mem)
11452 // match: (Store {t} ptr val mem)
11453 // cond: t.Size() == 4
11454 // result: (MOVLstore ptr val mem)
11456 t := auxToType(v.Aux)
11460 if !(t.Size() == 4) {
11463 v.reset(Op386MOVLstore)
11464 v.AddArg3(ptr, val, mem)
11467 // match: (Store {t} ptr val mem)
11468 // cond: t.Size() == 2
11469 // result: (MOVWstore ptr val mem)
11471 t := auxToType(v.Aux)
11475 if !(t.Size() == 2) {
11478 v.reset(Op386MOVWstore)
11479 v.AddArg3(ptr, val, mem)
11482 // match: (Store {t} ptr val mem)
11483 // cond: t.Size() == 1
11484 // result: (MOVBstore ptr val mem)
11486 t := auxToType(v.Aux)
11490 if !(t.Size() == 1) {
11493 v.reset(Op386MOVBstore)
11494 v.AddArg3(ptr, val, mem)
11499 func rewriteValue386_OpZero(v *Value) bool {
11503 config := b.Func.Config
11504 typ := &b.Func.Config.Types
11505 // match: (Zero [0] _ mem)
11508 if auxIntToInt64(v.AuxInt) != 0 {
11515 // match: (Zero [1] destptr mem)
11516 // result: (MOVBstoreconst [0] destptr mem)
11518 if auxIntToInt64(v.AuxInt) != 1 {
11523 v.reset(Op386MOVBstoreconst)
11524 v.AuxInt = valAndOffToAuxInt(0)
11525 v.AddArg2(destptr, mem)
11528 // match: (Zero [2] destptr mem)
11529 // result: (MOVWstoreconst [0] destptr mem)
11531 if auxIntToInt64(v.AuxInt) != 2 {
11536 v.reset(Op386MOVWstoreconst)
11537 v.AuxInt = valAndOffToAuxInt(0)
11538 v.AddArg2(destptr, mem)
11541 // match: (Zero [4] destptr mem)
11542 // result: (MOVLstoreconst [0] destptr mem)
11544 if auxIntToInt64(v.AuxInt) != 4 {
11549 v.reset(Op386MOVLstoreconst)
11550 v.AuxInt = valAndOffToAuxInt(0)
11551 v.AddArg2(destptr, mem)
11554 // match: (Zero [3] destptr mem)
11555 // result: (MOVBstoreconst [makeValAndOff(0,2)] destptr (MOVWstoreconst [makeValAndOff(0,0)] destptr mem))
11557 if auxIntToInt64(v.AuxInt) != 3 {
11562 v.reset(Op386MOVBstoreconst)
11563 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 2))
11564 v0 := b.NewValue0(v.Pos, Op386MOVWstoreconst, types.TypeMem)
11565 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11566 v0.AddArg2(destptr, mem)
11567 v.AddArg2(destptr, v0)
11570 // match: (Zero [5] destptr mem)
11571 // result: (MOVBstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11573 if auxIntToInt64(v.AuxInt) != 5 {
11578 v.reset(Op386MOVBstoreconst)
11579 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11580 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11581 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11582 v0.AddArg2(destptr, mem)
11583 v.AddArg2(destptr, v0)
11586 // match: (Zero [6] destptr mem)
11587 // result: (MOVWstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11589 if auxIntToInt64(v.AuxInt) != 6 {
11594 v.reset(Op386MOVWstoreconst)
11595 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11596 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11597 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11598 v0.AddArg2(destptr, mem)
11599 v.AddArg2(destptr, v0)
11602 // match: (Zero [7] destptr mem)
11603 // result: (MOVLstoreconst [makeValAndOff(0,3)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11605 if auxIntToInt64(v.AuxInt) != 7 {
11610 v.reset(Op386MOVLstoreconst)
11611 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 3))
11612 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11613 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11614 v0.AddArg2(destptr, mem)
11615 v.AddArg2(destptr, v0)
11618 // match: (Zero [s] destptr mem)
11619 // cond: s%4 != 0 && s > 4
11620 // result: (Zero [s-s%4] (ADDLconst destptr [int32(s%4)]) (MOVLstoreconst [0] destptr mem))
11622 s := auxIntToInt64(v.AuxInt)
11625 if !(s%4 != 0 && s > 4) {
11629 v.AuxInt = int64ToAuxInt(s - s%4)
11630 v0 := b.NewValue0(v.Pos, Op386ADDLconst, typ.UInt32)
11631 v0.AuxInt = int32ToAuxInt(int32(s % 4))
11633 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11634 v1.AuxInt = valAndOffToAuxInt(0)
11635 v1.AddArg2(destptr, mem)
11639 // match: (Zero [8] destptr mem)
11640 // result: (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11642 if auxIntToInt64(v.AuxInt) != 8 {
11647 v.reset(Op386MOVLstoreconst)
11648 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11649 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11650 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11651 v0.AddArg2(destptr, mem)
11652 v.AddArg2(destptr, v0)
11655 // match: (Zero [12] destptr mem)
11656 // result: (MOVLstoreconst [makeValAndOff(0,8)] destptr (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem)))
11658 if auxIntToInt64(v.AuxInt) != 12 {
11663 v.reset(Op386MOVLstoreconst)
11664 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
11665 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11666 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11667 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11668 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11669 v1.AddArg2(destptr, mem)
11670 v0.AddArg2(destptr, v1)
11671 v.AddArg2(destptr, v0)
11674 // match: (Zero [16] destptr mem)
11675 // result: (MOVLstoreconst [makeValAndOff(0,12)] destptr (MOVLstoreconst [makeValAndOff(0,8)] destptr (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))))
11677 if auxIntToInt64(v.AuxInt) != 16 {
11682 v.reset(Op386MOVLstoreconst)
11683 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 12))
11684 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11685 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
11686 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11687 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11688 v2 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11689 v2.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11690 v2.AddArg2(destptr, mem)
11691 v1.AddArg2(destptr, v2)
11692 v0.AddArg2(destptr, v1)
11693 v.AddArg2(destptr, v0)
11696 // match: (Zero [s] destptr mem)
11697 // cond: s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice
11698 // result: (DUFFZERO [1*(128-s/4)] destptr (MOVLconst [0]) mem)
11700 s := auxIntToInt64(v.AuxInt)
11703 if !(s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice) {
11706 v.reset(Op386DUFFZERO)
11707 v.AuxInt = int64ToAuxInt(1 * (128 - s/4))
11708 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11709 v0.AuxInt = int32ToAuxInt(0)
11710 v.AddArg3(destptr, v0, mem)
11713 // match: (Zero [s] destptr mem)
11714 // cond: (s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0
11715 // result: (REPSTOSL destptr (MOVLconst [int32(s/4)]) (MOVLconst [0]) mem)
11717 s := auxIntToInt64(v.AuxInt)
11720 if !((s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0) {
11723 v.reset(Op386REPSTOSL)
11724 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11725 v0.AuxInt = int32ToAuxInt(int32(s / 4))
11726 v1 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11727 v1.AuxInt = int32ToAuxInt(0)
11728 v.AddArg4(destptr, v0, v1, mem)
11733 func rewriteValue386_OpZeromask(v *Value) bool {
11736 // match: (Zeromask <t> x)
11737 // result: (XORLconst [-1] (SBBLcarrymask <t> (CMPLconst x [1])))
11741 v.reset(Op386XORLconst)
11742 v.AuxInt = int32ToAuxInt(-1)
11743 v0 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11744 v1 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11745 v1.AuxInt = int32ToAuxInt(1)
11752 func rewriteBlock386(b *Block) bool {
11755 // match: (EQ (InvertFlags cmp) yes no)
11756 // result: (EQ cmp yes no)
11757 for b.Controls[0].Op == Op386InvertFlags {
11758 v_0 := b.Controls[0]
11760 b.resetWithControl(Block386EQ, cmp)
11763 // match: (EQ (FlagEQ) yes no)
11764 // result: (First yes no)
11765 for b.Controls[0].Op == Op386FlagEQ {
11766 b.Reset(BlockFirst)
11769 // match: (EQ (FlagLT_ULT) yes no)
11770 // result: (First no yes)
11771 for b.Controls[0].Op == Op386FlagLT_ULT {
11772 b.Reset(BlockFirst)
11776 // match: (EQ (FlagLT_UGT) yes no)
11777 // result: (First no yes)
11778 for b.Controls[0].Op == Op386FlagLT_UGT {
11779 b.Reset(BlockFirst)
11783 // match: (EQ (FlagGT_ULT) yes no)
11784 // result: (First no yes)
11785 for b.Controls[0].Op == Op386FlagGT_ULT {
11786 b.Reset(BlockFirst)
11790 // match: (EQ (FlagGT_UGT) yes no)
11791 // result: (First no yes)
11792 for b.Controls[0].Op == Op386FlagGT_UGT {
11793 b.Reset(BlockFirst)
11798 // match: (GE (InvertFlags cmp) yes no)
11799 // result: (LE cmp yes no)
11800 for b.Controls[0].Op == Op386InvertFlags {
11801 v_0 := b.Controls[0]
11803 b.resetWithControl(Block386LE, cmp)
11806 // match: (GE (FlagEQ) yes no)
11807 // result: (First yes no)
11808 for b.Controls[0].Op == Op386FlagEQ {
11809 b.Reset(BlockFirst)
11812 // match: (GE (FlagLT_ULT) yes no)
11813 // result: (First no yes)
11814 for b.Controls[0].Op == Op386FlagLT_ULT {
11815 b.Reset(BlockFirst)
11819 // match: (GE (FlagLT_UGT) yes no)
11820 // result: (First no yes)
11821 for b.Controls[0].Op == Op386FlagLT_UGT {
11822 b.Reset(BlockFirst)
11826 // match: (GE (FlagGT_ULT) yes no)
11827 // result: (First yes no)
11828 for b.Controls[0].Op == Op386FlagGT_ULT {
11829 b.Reset(BlockFirst)
11832 // match: (GE (FlagGT_UGT) yes no)
11833 // result: (First yes no)
11834 for b.Controls[0].Op == Op386FlagGT_UGT {
11835 b.Reset(BlockFirst)
11839 // match: (GT (InvertFlags cmp) yes no)
11840 // result: (LT cmp yes no)
11841 for b.Controls[0].Op == Op386InvertFlags {
11842 v_0 := b.Controls[0]
11844 b.resetWithControl(Block386LT, cmp)
11847 // match: (GT (FlagEQ) yes no)
11848 // result: (First no yes)
11849 for b.Controls[0].Op == Op386FlagEQ {
11850 b.Reset(BlockFirst)
11854 // match: (GT (FlagLT_ULT) yes no)
11855 // result: (First no yes)
11856 for b.Controls[0].Op == Op386FlagLT_ULT {
11857 b.Reset(BlockFirst)
11861 // match: (GT (FlagLT_UGT) yes no)
11862 // result: (First no yes)
11863 for b.Controls[0].Op == Op386FlagLT_UGT {
11864 b.Reset(BlockFirst)
11868 // match: (GT (FlagGT_ULT) yes no)
11869 // result: (First yes no)
11870 for b.Controls[0].Op == Op386FlagGT_ULT {
11871 b.Reset(BlockFirst)
11874 // match: (GT (FlagGT_UGT) yes no)
11875 // result: (First yes no)
11876 for b.Controls[0].Op == Op386FlagGT_UGT {
11877 b.Reset(BlockFirst)
11881 // match: (If (SETL cmp) yes no)
11882 // result: (LT cmp yes no)
11883 for b.Controls[0].Op == Op386SETL {
11884 v_0 := b.Controls[0]
11886 b.resetWithControl(Block386LT, cmp)
11889 // match: (If (SETLE cmp) yes no)
11890 // result: (LE cmp yes no)
11891 for b.Controls[0].Op == Op386SETLE {
11892 v_0 := b.Controls[0]
11894 b.resetWithControl(Block386LE, cmp)
11897 // match: (If (SETG cmp) yes no)
11898 // result: (GT cmp yes no)
11899 for b.Controls[0].Op == Op386SETG {
11900 v_0 := b.Controls[0]
11902 b.resetWithControl(Block386GT, cmp)
11905 // match: (If (SETGE cmp) yes no)
11906 // result: (GE cmp yes no)
11907 for b.Controls[0].Op == Op386SETGE {
11908 v_0 := b.Controls[0]
11910 b.resetWithControl(Block386GE, cmp)
11913 // match: (If (SETEQ cmp) yes no)
11914 // result: (EQ cmp yes no)
11915 for b.Controls[0].Op == Op386SETEQ {
11916 v_0 := b.Controls[0]
11918 b.resetWithControl(Block386EQ, cmp)
11921 // match: (If (SETNE cmp) yes no)
11922 // result: (NE cmp yes no)
11923 for b.Controls[0].Op == Op386SETNE {
11924 v_0 := b.Controls[0]
11926 b.resetWithControl(Block386NE, cmp)
11929 // match: (If (SETB cmp) yes no)
11930 // result: (ULT cmp yes no)
11931 for b.Controls[0].Op == Op386SETB {
11932 v_0 := b.Controls[0]
11934 b.resetWithControl(Block386ULT, cmp)
11937 // match: (If (SETBE cmp) yes no)
11938 // result: (ULE cmp yes no)
11939 for b.Controls[0].Op == Op386SETBE {
11940 v_0 := b.Controls[0]
11942 b.resetWithControl(Block386ULE, cmp)
11945 // match: (If (SETA cmp) yes no)
11946 // result: (UGT cmp yes no)
11947 for b.Controls[0].Op == Op386SETA {
11948 v_0 := b.Controls[0]
11950 b.resetWithControl(Block386UGT, cmp)
11953 // match: (If (SETAE cmp) yes no)
11954 // result: (UGE cmp yes no)
11955 for b.Controls[0].Op == Op386SETAE {
11956 v_0 := b.Controls[0]
11958 b.resetWithControl(Block386UGE, cmp)
11961 // match: (If (SETO cmp) yes no)
11962 // result: (OS cmp yes no)
11963 for b.Controls[0].Op == Op386SETO {
11964 v_0 := b.Controls[0]
11966 b.resetWithControl(Block386OS, cmp)
11969 // match: (If (SETGF cmp) yes no)
11970 // result: (UGT cmp yes no)
11971 for b.Controls[0].Op == Op386SETGF {
11972 v_0 := b.Controls[0]
11974 b.resetWithControl(Block386UGT, cmp)
11977 // match: (If (SETGEF cmp) yes no)
11978 // result: (UGE cmp yes no)
11979 for b.Controls[0].Op == Op386SETGEF {
11980 v_0 := b.Controls[0]
11982 b.resetWithControl(Block386UGE, cmp)
11985 // match: (If (SETEQF cmp) yes no)
11986 // result: (EQF cmp yes no)
11987 for b.Controls[0].Op == Op386SETEQF {
11988 v_0 := b.Controls[0]
11990 b.resetWithControl(Block386EQF, cmp)
11993 // match: (If (SETNEF cmp) yes no)
11994 // result: (NEF cmp yes no)
11995 for b.Controls[0].Op == Op386SETNEF {
11996 v_0 := b.Controls[0]
11998 b.resetWithControl(Block386NEF, cmp)
12001 // match: (If cond yes no)
12002 // result: (NE (TESTB cond cond) yes no)
12004 cond := b.Controls[0]
12005 v0 := b.NewValue0(cond.Pos, Op386TESTB, types.TypeFlags)
12006 v0.AddArg2(cond, cond)
12007 b.resetWithControl(Block386NE, v0)
12011 // match: (LE (InvertFlags cmp) yes no)
12012 // result: (GE cmp yes no)
12013 for b.Controls[0].Op == Op386InvertFlags {
12014 v_0 := b.Controls[0]
12016 b.resetWithControl(Block386GE, cmp)
12019 // match: (LE (FlagEQ) yes no)
12020 // result: (First yes no)
12021 for b.Controls[0].Op == Op386FlagEQ {
12022 b.Reset(BlockFirst)
12025 // match: (LE (FlagLT_ULT) yes no)
12026 // result: (First yes no)
12027 for b.Controls[0].Op == Op386FlagLT_ULT {
12028 b.Reset(BlockFirst)
12031 // match: (LE (FlagLT_UGT) yes no)
12032 // result: (First yes no)
12033 for b.Controls[0].Op == Op386FlagLT_UGT {
12034 b.Reset(BlockFirst)
12037 // match: (LE (FlagGT_ULT) yes no)
12038 // result: (First no yes)
12039 for b.Controls[0].Op == Op386FlagGT_ULT {
12040 b.Reset(BlockFirst)
12044 // match: (LE (FlagGT_UGT) yes no)
12045 // result: (First no yes)
12046 for b.Controls[0].Op == Op386FlagGT_UGT {
12047 b.Reset(BlockFirst)
12052 // match: (LT (InvertFlags cmp) yes no)
12053 // result: (GT cmp yes no)
12054 for b.Controls[0].Op == Op386InvertFlags {
12055 v_0 := b.Controls[0]
12057 b.resetWithControl(Block386GT, cmp)
12060 // match: (LT (FlagEQ) yes no)
12061 // result: (First no yes)
12062 for b.Controls[0].Op == Op386FlagEQ {
12063 b.Reset(BlockFirst)
12067 // match: (LT (FlagLT_ULT) yes no)
12068 // result: (First yes no)
12069 for b.Controls[0].Op == Op386FlagLT_ULT {
12070 b.Reset(BlockFirst)
12073 // match: (LT (FlagLT_UGT) yes no)
12074 // result: (First yes no)
12075 for b.Controls[0].Op == Op386FlagLT_UGT {
12076 b.Reset(BlockFirst)
12079 // match: (LT (FlagGT_ULT) yes no)
12080 // result: (First no yes)
12081 for b.Controls[0].Op == Op386FlagGT_ULT {
12082 b.Reset(BlockFirst)
12086 // match: (LT (FlagGT_UGT) yes no)
12087 // result: (First no yes)
12088 for b.Controls[0].Op == Op386FlagGT_UGT {
12089 b.Reset(BlockFirst)
12094 // match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
12095 // result: (LT cmp yes no)
12096 for b.Controls[0].Op == Op386TESTB {
12097 v_0 := b.Controls[0]
12099 v_0_0 := v_0.Args[0]
12100 if v_0_0.Op != Op386SETL {
12103 cmp := v_0_0.Args[0]
12104 v_0_1 := v_0.Args[1]
12105 if v_0_1.Op != Op386SETL || cmp != v_0_1.Args[0] {
12108 b.resetWithControl(Block386LT, cmp)
12111 // match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
12112 // result: (LE cmp yes no)
12113 for b.Controls[0].Op == Op386TESTB {
12114 v_0 := b.Controls[0]
12116 v_0_0 := v_0.Args[0]
12117 if v_0_0.Op != Op386SETLE {
12120 cmp := v_0_0.Args[0]
12121 v_0_1 := v_0.Args[1]
12122 if v_0_1.Op != Op386SETLE || cmp != v_0_1.Args[0] {
12125 b.resetWithControl(Block386LE, cmp)
12128 // match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
12129 // result: (GT cmp yes no)
12130 for b.Controls[0].Op == Op386TESTB {
12131 v_0 := b.Controls[0]
12133 v_0_0 := v_0.Args[0]
12134 if v_0_0.Op != Op386SETG {
12137 cmp := v_0_0.Args[0]
12138 v_0_1 := v_0.Args[1]
12139 if v_0_1.Op != Op386SETG || cmp != v_0_1.Args[0] {
12142 b.resetWithControl(Block386GT, cmp)
12145 // match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
12146 // result: (GE cmp yes no)
12147 for b.Controls[0].Op == Op386TESTB {
12148 v_0 := b.Controls[0]
12150 v_0_0 := v_0.Args[0]
12151 if v_0_0.Op != Op386SETGE {
12154 cmp := v_0_0.Args[0]
12155 v_0_1 := v_0.Args[1]
12156 if v_0_1.Op != Op386SETGE || cmp != v_0_1.Args[0] {
12159 b.resetWithControl(Block386GE, cmp)
12162 // match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
12163 // result: (EQ cmp yes no)
12164 for b.Controls[0].Op == Op386TESTB {
12165 v_0 := b.Controls[0]
12167 v_0_0 := v_0.Args[0]
12168 if v_0_0.Op != Op386SETEQ {
12171 cmp := v_0_0.Args[0]
12172 v_0_1 := v_0.Args[1]
12173 if v_0_1.Op != Op386SETEQ || cmp != v_0_1.Args[0] {
12176 b.resetWithControl(Block386EQ, cmp)
12179 // match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
12180 // result: (NE cmp yes no)
12181 for b.Controls[0].Op == Op386TESTB {
12182 v_0 := b.Controls[0]
12184 v_0_0 := v_0.Args[0]
12185 if v_0_0.Op != Op386SETNE {
12188 cmp := v_0_0.Args[0]
12189 v_0_1 := v_0.Args[1]
12190 if v_0_1.Op != Op386SETNE || cmp != v_0_1.Args[0] {
12193 b.resetWithControl(Block386NE, cmp)
12196 // match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
12197 // result: (ULT cmp yes no)
12198 for b.Controls[0].Op == Op386TESTB {
12199 v_0 := b.Controls[0]
12201 v_0_0 := v_0.Args[0]
12202 if v_0_0.Op != Op386SETB {
12205 cmp := v_0_0.Args[0]
12206 v_0_1 := v_0.Args[1]
12207 if v_0_1.Op != Op386SETB || cmp != v_0_1.Args[0] {
12210 b.resetWithControl(Block386ULT, cmp)
12213 // match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
12214 // result: (ULE cmp yes no)
12215 for b.Controls[0].Op == Op386TESTB {
12216 v_0 := b.Controls[0]
12218 v_0_0 := v_0.Args[0]
12219 if v_0_0.Op != Op386SETBE {
12222 cmp := v_0_0.Args[0]
12223 v_0_1 := v_0.Args[1]
12224 if v_0_1.Op != Op386SETBE || cmp != v_0_1.Args[0] {
12227 b.resetWithControl(Block386ULE, cmp)
12230 // match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
12231 // result: (UGT cmp yes no)
12232 for b.Controls[0].Op == Op386TESTB {
12233 v_0 := b.Controls[0]
12235 v_0_0 := v_0.Args[0]
12236 if v_0_0.Op != Op386SETA {
12239 cmp := v_0_0.Args[0]
12240 v_0_1 := v_0.Args[1]
12241 if v_0_1.Op != Op386SETA || cmp != v_0_1.Args[0] {
12244 b.resetWithControl(Block386UGT, cmp)
12247 // match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
12248 // result: (UGE cmp yes no)
12249 for b.Controls[0].Op == Op386TESTB {
12250 v_0 := b.Controls[0]
12252 v_0_0 := v_0.Args[0]
12253 if v_0_0.Op != Op386SETAE {
12256 cmp := v_0_0.Args[0]
12257 v_0_1 := v_0.Args[1]
12258 if v_0_1.Op != Op386SETAE || cmp != v_0_1.Args[0] {
12261 b.resetWithControl(Block386UGE, cmp)
12264 // match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
12265 // result: (OS cmp yes no)
12266 for b.Controls[0].Op == Op386TESTB {
12267 v_0 := b.Controls[0]
12269 v_0_0 := v_0.Args[0]
12270 if v_0_0.Op != Op386SETO {
12273 cmp := v_0_0.Args[0]
12274 v_0_1 := v_0.Args[1]
12275 if v_0_1.Op != Op386SETO || cmp != v_0_1.Args[0] {
12278 b.resetWithControl(Block386OS, cmp)
12281 // match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
12282 // result: (UGT cmp yes no)
12283 for b.Controls[0].Op == Op386TESTB {
12284 v_0 := b.Controls[0]
12286 v_0_0 := v_0.Args[0]
12287 if v_0_0.Op != Op386SETGF {
12290 cmp := v_0_0.Args[0]
12291 v_0_1 := v_0.Args[1]
12292 if v_0_1.Op != Op386SETGF || cmp != v_0_1.Args[0] {
12295 b.resetWithControl(Block386UGT, cmp)
12298 // match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
12299 // result: (UGE cmp yes no)
12300 for b.Controls[0].Op == Op386TESTB {
12301 v_0 := b.Controls[0]
12303 v_0_0 := v_0.Args[0]
12304 if v_0_0.Op != Op386SETGEF {
12307 cmp := v_0_0.Args[0]
12308 v_0_1 := v_0.Args[1]
12309 if v_0_1.Op != Op386SETGEF || cmp != v_0_1.Args[0] {
12312 b.resetWithControl(Block386UGE, cmp)
12315 // match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
12316 // result: (EQF cmp yes no)
12317 for b.Controls[0].Op == Op386TESTB {
12318 v_0 := b.Controls[0]
12320 v_0_0 := v_0.Args[0]
12321 if v_0_0.Op != Op386SETEQF {
12324 cmp := v_0_0.Args[0]
12325 v_0_1 := v_0.Args[1]
12326 if v_0_1.Op != Op386SETEQF || cmp != v_0_1.Args[0] {
12329 b.resetWithControl(Block386EQF, cmp)
12332 // match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
12333 // result: (NEF cmp yes no)
12334 for b.Controls[0].Op == Op386TESTB {
12335 v_0 := b.Controls[0]
12337 v_0_0 := v_0.Args[0]
12338 if v_0_0.Op != Op386SETNEF {
12341 cmp := v_0_0.Args[0]
12342 v_0_1 := v_0.Args[1]
12343 if v_0_1.Op != Op386SETNEF || cmp != v_0_1.Args[0] {
12346 b.resetWithControl(Block386NEF, cmp)
12349 // match: (NE (InvertFlags cmp) yes no)
12350 // result: (NE cmp yes no)
12351 for b.Controls[0].Op == Op386InvertFlags {
12352 v_0 := b.Controls[0]
12354 b.resetWithControl(Block386NE, cmp)
12357 // match: (NE (FlagEQ) yes no)
12358 // result: (First no yes)
12359 for b.Controls[0].Op == Op386FlagEQ {
12360 b.Reset(BlockFirst)
12364 // match: (NE (FlagLT_ULT) yes no)
12365 // result: (First yes no)
12366 for b.Controls[0].Op == Op386FlagLT_ULT {
12367 b.Reset(BlockFirst)
12370 // match: (NE (FlagLT_UGT) yes no)
12371 // result: (First yes no)
12372 for b.Controls[0].Op == Op386FlagLT_UGT {
12373 b.Reset(BlockFirst)
12376 // match: (NE (FlagGT_ULT) yes no)
12377 // result: (First yes no)
12378 for b.Controls[0].Op == Op386FlagGT_ULT {
12379 b.Reset(BlockFirst)
12382 // match: (NE (FlagGT_UGT) yes no)
12383 // result: (First yes no)
12384 for b.Controls[0].Op == Op386FlagGT_UGT {
12385 b.Reset(BlockFirst)
12389 // match: (UGE (InvertFlags cmp) yes no)
12390 // result: (ULE cmp yes no)
12391 for b.Controls[0].Op == Op386InvertFlags {
12392 v_0 := b.Controls[0]
12394 b.resetWithControl(Block386ULE, cmp)
12397 // match: (UGE (FlagEQ) yes no)
12398 // result: (First yes no)
12399 for b.Controls[0].Op == Op386FlagEQ {
12400 b.Reset(BlockFirst)
12403 // match: (UGE (FlagLT_ULT) yes no)
12404 // result: (First no yes)
12405 for b.Controls[0].Op == Op386FlagLT_ULT {
12406 b.Reset(BlockFirst)
12410 // match: (UGE (FlagLT_UGT) yes no)
12411 // result: (First yes no)
12412 for b.Controls[0].Op == Op386FlagLT_UGT {
12413 b.Reset(BlockFirst)
12416 // match: (UGE (FlagGT_ULT) yes no)
12417 // result: (First no yes)
12418 for b.Controls[0].Op == Op386FlagGT_ULT {
12419 b.Reset(BlockFirst)
12423 // match: (UGE (FlagGT_UGT) yes no)
12424 // result: (First yes no)
12425 for b.Controls[0].Op == Op386FlagGT_UGT {
12426 b.Reset(BlockFirst)
12430 // match: (UGT (InvertFlags cmp) yes no)
12431 // result: (ULT cmp yes no)
12432 for b.Controls[0].Op == Op386InvertFlags {
12433 v_0 := b.Controls[0]
12435 b.resetWithControl(Block386ULT, cmp)
12438 // match: (UGT (FlagEQ) yes no)
12439 // result: (First no yes)
12440 for b.Controls[0].Op == Op386FlagEQ {
12441 b.Reset(BlockFirst)
12445 // match: (UGT (FlagLT_ULT) yes no)
12446 // result: (First no yes)
12447 for b.Controls[0].Op == Op386FlagLT_ULT {
12448 b.Reset(BlockFirst)
12452 // match: (UGT (FlagLT_UGT) yes no)
12453 // result: (First yes no)
12454 for b.Controls[0].Op == Op386FlagLT_UGT {
12455 b.Reset(BlockFirst)
12458 // match: (UGT (FlagGT_ULT) yes no)
12459 // result: (First no yes)
12460 for b.Controls[0].Op == Op386FlagGT_ULT {
12461 b.Reset(BlockFirst)
12465 // match: (UGT (FlagGT_UGT) yes no)
12466 // result: (First yes no)
12467 for b.Controls[0].Op == Op386FlagGT_UGT {
12468 b.Reset(BlockFirst)
12472 // match: (ULE (InvertFlags cmp) yes no)
12473 // result: (UGE cmp yes no)
12474 for b.Controls[0].Op == Op386InvertFlags {
12475 v_0 := b.Controls[0]
12477 b.resetWithControl(Block386UGE, cmp)
12480 // match: (ULE (FlagEQ) yes no)
12481 // result: (First yes no)
12482 for b.Controls[0].Op == Op386FlagEQ {
12483 b.Reset(BlockFirst)
12486 // match: (ULE (FlagLT_ULT) yes no)
12487 // result: (First yes no)
12488 for b.Controls[0].Op == Op386FlagLT_ULT {
12489 b.Reset(BlockFirst)
12492 // match: (ULE (FlagLT_UGT) yes no)
12493 // result: (First no yes)
12494 for b.Controls[0].Op == Op386FlagLT_UGT {
12495 b.Reset(BlockFirst)
12499 // match: (ULE (FlagGT_ULT) yes no)
12500 // result: (First yes no)
12501 for b.Controls[0].Op == Op386FlagGT_ULT {
12502 b.Reset(BlockFirst)
12505 // match: (ULE (FlagGT_UGT) yes no)
12506 // result: (First no yes)
12507 for b.Controls[0].Op == Op386FlagGT_UGT {
12508 b.Reset(BlockFirst)
12513 // match: (ULT (InvertFlags cmp) yes no)
12514 // result: (UGT cmp yes no)
12515 for b.Controls[0].Op == Op386InvertFlags {
12516 v_0 := b.Controls[0]
12518 b.resetWithControl(Block386UGT, cmp)
12521 // match: (ULT (FlagEQ) yes no)
12522 // result: (First no yes)
12523 for b.Controls[0].Op == Op386FlagEQ {
12524 b.Reset(BlockFirst)
12528 // match: (ULT (FlagLT_ULT) yes no)
12529 // result: (First yes no)
12530 for b.Controls[0].Op == Op386FlagLT_ULT {
12531 b.Reset(BlockFirst)
12534 // match: (ULT (FlagLT_UGT) yes no)
12535 // result: (First no yes)
12536 for b.Controls[0].Op == Op386FlagLT_UGT {
12537 b.Reset(BlockFirst)
12541 // match: (ULT (FlagGT_ULT) yes no)
12542 // result: (First yes no)
12543 for b.Controls[0].Op == Op386FlagGT_ULT {
12544 b.Reset(BlockFirst)
12547 // match: (ULT (FlagGT_UGT) yes no)
12548 // result: (First no yes)
12549 for b.Controls[0].Op == Op386FlagGT_UGT {
12550 b.Reset(BlockFirst)