1
2
3 package ssa
4
5 import "math"
6 import "cmd/compile/internal/types"
7
8 func rewriteValue386(v *Value) bool {
9 switch v.Op {
10 case Op386ADCL:
11 return rewriteValue386_Op386ADCL(v)
12 case Op386ADDL:
13 return rewriteValue386_Op386ADDL(v)
14 case Op386ADDLcarry:
15 return rewriteValue386_Op386ADDLcarry(v)
16 case Op386ADDLconst:
17 return rewriteValue386_Op386ADDLconst(v)
18 case Op386ADDLconstmodify:
19 return rewriteValue386_Op386ADDLconstmodify(v)
20 case Op386ADDLload:
21 return rewriteValue386_Op386ADDLload(v)
22 case Op386ADDLmodify:
23 return rewriteValue386_Op386ADDLmodify(v)
24 case Op386ADDSD:
25 return rewriteValue386_Op386ADDSD(v)
26 case Op386ADDSDload:
27 return rewriteValue386_Op386ADDSDload(v)
28 case Op386ADDSS:
29 return rewriteValue386_Op386ADDSS(v)
30 case Op386ADDSSload:
31 return rewriteValue386_Op386ADDSSload(v)
32 case Op386ANDL:
33 return rewriteValue386_Op386ANDL(v)
34 case Op386ANDLconst:
35 return rewriteValue386_Op386ANDLconst(v)
36 case Op386ANDLconstmodify:
37 return rewriteValue386_Op386ANDLconstmodify(v)
38 case Op386ANDLload:
39 return rewriteValue386_Op386ANDLload(v)
40 case Op386ANDLmodify:
41 return rewriteValue386_Op386ANDLmodify(v)
42 case Op386CMPB:
43 return rewriteValue386_Op386CMPB(v)
44 case Op386CMPBconst:
45 return rewriteValue386_Op386CMPBconst(v)
46 case Op386CMPBload:
47 return rewriteValue386_Op386CMPBload(v)
48 case Op386CMPL:
49 return rewriteValue386_Op386CMPL(v)
50 case Op386CMPLconst:
51 return rewriteValue386_Op386CMPLconst(v)
52 case Op386CMPLload:
53 return rewriteValue386_Op386CMPLload(v)
54 case Op386CMPW:
55 return rewriteValue386_Op386CMPW(v)
56 case Op386CMPWconst:
57 return rewriteValue386_Op386CMPWconst(v)
58 case Op386CMPWload:
59 return rewriteValue386_Op386CMPWload(v)
60 case Op386DIVSD:
61 return rewriteValue386_Op386DIVSD(v)
62 case Op386DIVSDload:
63 return rewriteValue386_Op386DIVSDload(v)
64 case Op386DIVSS:
65 return rewriteValue386_Op386DIVSS(v)
66 case Op386DIVSSload:
67 return rewriteValue386_Op386DIVSSload(v)
68 case Op386LEAL:
69 return rewriteValue386_Op386LEAL(v)
70 case Op386LEAL1:
71 return rewriteValue386_Op386LEAL1(v)
72 case Op386LEAL2:
73 return rewriteValue386_Op386LEAL2(v)
74 case Op386LEAL4:
75 return rewriteValue386_Op386LEAL4(v)
76 case Op386LEAL8:
77 return rewriteValue386_Op386LEAL8(v)
78 case Op386MOVBLSX:
79 return rewriteValue386_Op386MOVBLSX(v)
80 case Op386MOVBLSXload:
81 return rewriteValue386_Op386MOVBLSXload(v)
82 case Op386MOVBLZX:
83 return rewriteValue386_Op386MOVBLZX(v)
84 case Op386MOVBload:
85 return rewriteValue386_Op386MOVBload(v)
86 case Op386MOVBstore:
87 return rewriteValue386_Op386MOVBstore(v)
88 case Op386MOVBstoreconst:
89 return rewriteValue386_Op386MOVBstoreconst(v)
90 case Op386MOVLload:
91 return rewriteValue386_Op386MOVLload(v)
92 case Op386MOVLstore:
93 return rewriteValue386_Op386MOVLstore(v)
94 case Op386MOVLstoreconst:
95 return rewriteValue386_Op386MOVLstoreconst(v)
96 case Op386MOVSDconst:
97 return rewriteValue386_Op386MOVSDconst(v)
98 case Op386MOVSDload:
99 return rewriteValue386_Op386MOVSDload(v)
100 case Op386MOVSDstore:
101 return rewriteValue386_Op386MOVSDstore(v)
102 case Op386MOVSSconst:
103 return rewriteValue386_Op386MOVSSconst(v)
104 case Op386MOVSSload:
105 return rewriteValue386_Op386MOVSSload(v)
106 case Op386MOVSSstore:
107 return rewriteValue386_Op386MOVSSstore(v)
108 case Op386MOVWLSX:
109 return rewriteValue386_Op386MOVWLSX(v)
110 case Op386MOVWLSXload:
111 return rewriteValue386_Op386MOVWLSXload(v)
112 case Op386MOVWLZX:
113 return rewriteValue386_Op386MOVWLZX(v)
114 case Op386MOVWload:
115 return rewriteValue386_Op386MOVWload(v)
116 case Op386MOVWstore:
117 return rewriteValue386_Op386MOVWstore(v)
118 case Op386MOVWstoreconst:
119 return rewriteValue386_Op386MOVWstoreconst(v)
120 case Op386MULL:
121 return rewriteValue386_Op386MULL(v)
122 case Op386MULLconst:
123 return rewriteValue386_Op386MULLconst(v)
124 case Op386MULLload:
125 return rewriteValue386_Op386MULLload(v)
126 case Op386MULSD:
127 return rewriteValue386_Op386MULSD(v)
128 case Op386MULSDload:
129 return rewriteValue386_Op386MULSDload(v)
130 case Op386MULSS:
131 return rewriteValue386_Op386MULSS(v)
132 case Op386MULSSload:
133 return rewriteValue386_Op386MULSSload(v)
134 case Op386NEGL:
135 return rewriteValue386_Op386NEGL(v)
136 case Op386NOTL:
137 return rewriteValue386_Op386NOTL(v)
138 case Op386ORL:
139 return rewriteValue386_Op386ORL(v)
140 case Op386ORLconst:
141 return rewriteValue386_Op386ORLconst(v)
142 case Op386ORLconstmodify:
143 return rewriteValue386_Op386ORLconstmodify(v)
144 case Op386ORLload:
145 return rewriteValue386_Op386ORLload(v)
146 case Op386ORLmodify:
147 return rewriteValue386_Op386ORLmodify(v)
148 case Op386ROLB:
149 return rewriteValue386_Op386ROLB(v)
150 case Op386ROLBconst:
151 return rewriteValue386_Op386ROLBconst(v)
152 case Op386ROLL:
153 return rewriteValue386_Op386ROLL(v)
154 case Op386ROLLconst:
155 return rewriteValue386_Op386ROLLconst(v)
156 case Op386ROLW:
157 return rewriteValue386_Op386ROLW(v)
158 case Op386ROLWconst:
159 return rewriteValue386_Op386ROLWconst(v)
160 case Op386SARB:
161 return rewriteValue386_Op386SARB(v)
162 case Op386SARBconst:
163 return rewriteValue386_Op386SARBconst(v)
164 case Op386SARL:
165 return rewriteValue386_Op386SARL(v)
166 case Op386SARLconst:
167 return rewriteValue386_Op386SARLconst(v)
168 case Op386SARW:
169 return rewriteValue386_Op386SARW(v)
170 case Op386SARWconst:
171 return rewriteValue386_Op386SARWconst(v)
172 case Op386SBBL:
173 return rewriteValue386_Op386SBBL(v)
174 case Op386SBBLcarrymask:
175 return rewriteValue386_Op386SBBLcarrymask(v)
176 case Op386SETA:
177 return rewriteValue386_Op386SETA(v)
178 case Op386SETAE:
179 return rewriteValue386_Op386SETAE(v)
180 case Op386SETB:
181 return rewriteValue386_Op386SETB(v)
182 case Op386SETBE:
183 return rewriteValue386_Op386SETBE(v)
184 case Op386SETEQ:
185 return rewriteValue386_Op386SETEQ(v)
186 case Op386SETG:
187 return rewriteValue386_Op386SETG(v)
188 case Op386SETGE:
189 return rewriteValue386_Op386SETGE(v)
190 case Op386SETL:
191 return rewriteValue386_Op386SETL(v)
192 case Op386SETLE:
193 return rewriteValue386_Op386SETLE(v)
194 case Op386SETNE:
195 return rewriteValue386_Op386SETNE(v)
196 case Op386SHLL:
197 return rewriteValue386_Op386SHLL(v)
198 case Op386SHLLconst:
199 return rewriteValue386_Op386SHLLconst(v)
200 case Op386SHRB:
201 return rewriteValue386_Op386SHRB(v)
202 case Op386SHRBconst:
203 return rewriteValue386_Op386SHRBconst(v)
204 case Op386SHRL:
205 return rewriteValue386_Op386SHRL(v)
206 case Op386SHRLconst:
207 return rewriteValue386_Op386SHRLconst(v)
208 case Op386SHRW:
209 return rewriteValue386_Op386SHRW(v)
210 case Op386SHRWconst:
211 return rewriteValue386_Op386SHRWconst(v)
212 case Op386SUBL:
213 return rewriteValue386_Op386SUBL(v)
214 case Op386SUBLcarry:
215 return rewriteValue386_Op386SUBLcarry(v)
216 case Op386SUBLconst:
217 return rewriteValue386_Op386SUBLconst(v)
218 case Op386SUBLload:
219 return rewriteValue386_Op386SUBLload(v)
220 case Op386SUBLmodify:
221 return rewriteValue386_Op386SUBLmodify(v)
222 case Op386SUBSD:
223 return rewriteValue386_Op386SUBSD(v)
224 case Op386SUBSDload:
225 return rewriteValue386_Op386SUBSDload(v)
226 case Op386SUBSS:
227 return rewriteValue386_Op386SUBSS(v)
228 case Op386SUBSSload:
229 return rewriteValue386_Op386SUBSSload(v)
230 case Op386XORL:
231 return rewriteValue386_Op386XORL(v)
232 case Op386XORLconst:
233 return rewriteValue386_Op386XORLconst(v)
234 case Op386XORLconstmodify:
235 return rewriteValue386_Op386XORLconstmodify(v)
236 case Op386XORLload:
237 return rewriteValue386_Op386XORLload(v)
238 case Op386XORLmodify:
239 return rewriteValue386_Op386XORLmodify(v)
240 case OpAdd16:
241 v.Op = Op386ADDL
242 return true
243 case OpAdd32:
244 v.Op = Op386ADDL
245 return true
246 case OpAdd32F:
247 v.Op = Op386ADDSS
248 return true
249 case OpAdd32carry:
250 v.Op = Op386ADDLcarry
251 return true
252 case OpAdd32withcarry:
253 v.Op = Op386ADCL
254 return true
255 case OpAdd64F:
256 v.Op = Op386ADDSD
257 return true
258 case OpAdd8:
259 v.Op = Op386ADDL
260 return true
261 case OpAddPtr:
262 v.Op = Op386ADDL
263 return true
264 case OpAddr:
265 return rewriteValue386_OpAddr(v)
266 case OpAnd16:
267 v.Op = Op386ANDL
268 return true
269 case OpAnd32:
270 v.Op = Op386ANDL
271 return true
272 case OpAnd8:
273 v.Op = Op386ANDL
274 return true
275 case OpAndB:
276 v.Op = Op386ANDL
277 return true
278 case OpAvg32u:
279 v.Op = Op386AVGLU
280 return true
281 case OpBswap16:
282 return rewriteValue386_OpBswap16(v)
283 case OpBswap32:
284 v.Op = Op386BSWAPL
285 return true
286 case OpClosureCall:
287 v.Op = Op386CALLclosure
288 return true
289 case OpCom16:
290 v.Op = Op386NOTL
291 return true
292 case OpCom32:
293 v.Op = Op386NOTL
294 return true
295 case OpCom8:
296 v.Op = Op386NOTL
297 return true
298 case OpConst16:
299 return rewriteValue386_OpConst16(v)
300 case OpConst32:
301 v.Op = Op386MOVLconst
302 return true
303 case OpConst32F:
304 v.Op = Op386MOVSSconst
305 return true
306 case OpConst64F:
307 v.Op = Op386MOVSDconst
308 return true
309 case OpConst8:
310 return rewriteValue386_OpConst8(v)
311 case OpConstBool:
312 return rewriteValue386_OpConstBool(v)
313 case OpConstNil:
314 return rewriteValue386_OpConstNil(v)
315 case OpCtz16:
316 return rewriteValue386_OpCtz16(v)
317 case OpCtz16NonZero:
318 v.Op = Op386BSFL
319 return true
320 case OpCtz32:
321 v.Op = Op386LoweredCtz32
322 return true
323 case OpCtz32NonZero:
324 v.Op = Op386BSFL
325 return true
326 case OpCtz64On32:
327 v.Op = Op386LoweredCtz64
328 return true
329 case OpCtz8:
330 return rewriteValue386_OpCtz8(v)
331 case OpCtz8NonZero:
332 v.Op = Op386BSFL
333 return true
334 case OpCvt32Fto32:
335 v.Op = Op386CVTTSS2SL
336 return true
337 case OpCvt32Fto64F:
338 v.Op = Op386CVTSS2SD
339 return true
340 case OpCvt32to32F:
341 v.Op = Op386CVTSL2SS
342 return true
343 case OpCvt32to64F:
344 v.Op = Op386CVTSL2SD
345 return true
346 case OpCvt64Fto32:
347 v.Op = Op386CVTTSD2SL
348 return true
349 case OpCvt64Fto32F:
350 v.Op = Op386CVTSD2SS
351 return true
352 case OpCvtBoolToUint8:
353 v.Op = OpCopy
354 return true
355 case OpDiv16:
356 v.Op = Op386DIVW
357 return true
358 case OpDiv16u:
359 v.Op = Op386DIVWU
360 return true
361 case OpDiv32:
362 v.Op = Op386DIVL
363 return true
364 case OpDiv32F:
365 v.Op = Op386DIVSS
366 return true
367 case OpDiv32u:
368 v.Op = Op386DIVLU
369 return true
370 case OpDiv64F:
371 v.Op = Op386DIVSD
372 return true
373 case OpDiv8:
374 return rewriteValue386_OpDiv8(v)
375 case OpDiv8u:
376 return rewriteValue386_OpDiv8u(v)
377 case OpEq16:
378 return rewriteValue386_OpEq16(v)
379 case OpEq32:
380 return rewriteValue386_OpEq32(v)
381 case OpEq32F:
382 return rewriteValue386_OpEq32F(v)
383 case OpEq64F:
384 return rewriteValue386_OpEq64F(v)
385 case OpEq8:
386 return rewriteValue386_OpEq8(v)
387 case OpEqB:
388 return rewriteValue386_OpEqB(v)
389 case OpEqPtr:
390 return rewriteValue386_OpEqPtr(v)
391 case OpGetCallerPC:
392 v.Op = Op386LoweredGetCallerPC
393 return true
394 case OpGetCallerSP:
395 v.Op = Op386LoweredGetCallerSP
396 return true
397 case OpGetClosurePtr:
398 v.Op = Op386LoweredGetClosurePtr
399 return true
400 case OpGetG:
401 v.Op = Op386LoweredGetG
402 return true
403 case OpHmul32:
404 v.Op = Op386HMULL
405 return true
406 case OpHmul32u:
407 v.Op = Op386HMULLU
408 return true
409 case OpInterCall:
410 v.Op = Op386CALLinter
411 return true
412 case OpIsInBounds:
413 return rewriteValue386_OpIsInBounds(v)
414 case OpIsNonNil:
415 return rewriteValue386_OpIsNonNil(v)
416 case OpIsSliceInBounds:
417 return rewriteValue386_OpIsSliceInBounds(v)
418 case OpLeq16:
419 return rewriteValue386_OpLeq16(v)
420 case OpLeq16U:
421 return rewriteValue386_OpLeq16U(v)
422 case OpLeq32:
423 return rewriteValue386_OpLeq32(v)
424 case OpLeq32F:
425 return rewriteValue386_OpLeq32F(v)
426 case OpLeq32U:
427 return rewriteValue386_OpLeq32U(v)
428 case OpLeq64F:
429 return rewriteValue386_OpLeq64F(v)
430 case OpLeq8:
431 return rewriteValue386_OpLeq8(v)
432 case OpLeq8U:
433 return rewriteValue386_OpLeq8U(v)
434 case OpLess16:
435 return rewriteValue386_OpLess16(v)
436 case OpLess16U:
437 return rewriteValue386_OpLess16U(v)
438 case OpLess32:
439 return rewriteValue386_OpLess32(v)
440 case OpLess32F:
441 return rewriteValue386_OpLess32F(v)
442 case OpLess32U:
443 return rewriteValue386_OpLess32U(v)
444 case OpLess64F:
445 return rewriteValue386_OpLess64F(v)
446 case OpLess8:
447 return rewriteValue386_OpLess8(v)
448 case OpLess8U:
449 return rewriteValue386_OpLess8U(v)
450 case OpLoad:
451 return rewriteValue386_OpLoad(v)
452 case OpLocalAddr:
453 return rewriteValue386_OpLocalAddr(v)
454 case OpLsh16x16:
455 return rewriteValue386_OpLsh16x16(v)
456 case OpLsh16x32:
457 return rewriteValue386_OpLsh16x32(v)
458 case OpLsh16x64:
459 return rewriteValue386_OpLsh16x64(v)
460 case OpLsh16x8:
461 return rewriteValue386_OpLsh16x8(v)
462 case OpLsh32x16:
463 return rewriteValue386_OpLsh32x16(v)
464 case OpLsh32x32:
465 return rewriteValue386_OpLsh32x32(v)
466 case OpLsh32x64:
467 return rewriteValue386_OpLsh32x64(v)
468 case OpLsh32x8:
469 return rewriteValue386_OpLsh32x8(v)
470 case OpLsh8x16:
471 return rewriteValue386_OpLsh8x16(v)
472 case OpLsh8x32:
473 return rewriteValue386_OpLsh8x32(v)
474 case OpLsh8x64:
475 return rewriteValue386_OpLsh8x64(v)
476 case OpLsh8x8:
477 return rewriteValue386_OpLsh8x8(v)
478 case OpMod16:
479 v.Op = Op386MODW
480 return true
481 case OpMod16u:
482 v.Op = Op386MODWU
483 return true
484 case OpMod32:
485 v.Op = Op386MODL
486 return true
487 case OpMod32u:
488 v.Op = Op386MODLU
489 return true
490 case OpMod8:
491 return rewriteValue386_OpMod8(v)
492 case OpMod8u:
493 return rewriteValue386_OpMod8u(v)
494 case OpMove:
495 return rewriteValue386_OpMove(v)
496 case OpMul16:
497 v.Op = Op386MULL
498 return true
499 case OpMul32:
500 v.Op = Op386MULL
501 return true
502 case OpMul32F:
503 v.Op = Op386MULSS
504 return true
505 case OpMul32uhilo:
506 v.Op = Op386MULLQU
507 return true
508 case OpMul64F:
509 v.Op = Op386MULSD
510 return true
511 case OpMul8:
512 v.Op = Op386MULL
513 return true
514 case OpNeg16:
515 v.Op = Op386NEGL
516 return true
517 case OpNeg32:
518 v.Op = Op386NEGL
519 return true
520 case OpNeg32F:
521 return rewriteValue386_OpNeg32F(v)
522 case OpNeg64F:
523 return rewriteValue386_OpNeg64F(v)
524 case OpNeg8:
525 v.Op = Op386NEGL
526 return true
527 case OpNeq16:
528 return rewriteValue386_OpNeq16(v)
529 case OpNeq32:
530 return rewriteValue386_OpNeq32(v)
531 case OpNeq32F:
532 return rewriteValue386_OpNeq32F(v)
533 case OpNeq64F:
534 return rewriteValue386_OpNeq64F(v)
535 case OpNeq8:
536 return rewriteValue386_OpNeq8(v)
537 case OpNeqB:
538 return rewriteValue386_OpNeqB(v)
539 case OpNeqPtr:
540 return rewriteValue386_OpNeqPtr(v)
541 case OpNilCheck:
542 v.Op = Op386LoweredNilCheck
543 return true
544 case OpNot:
545 return rewriteValue386_OpNot(v)
546 case OpOffPtr:
547 return rewriteValue386_OpOffPtr(v)
548 case OpOr16:
549 v.Op = Op386ORL
550 return true
551 case OpOr32:
552 v.Op = Op386ORL
553 return true
554 case OpOr8:
555 v.Op = Op386ORL
556 return true
557 case OpOrB:
558 v.Op = Op386ORL
559 return true
560 case OpPanicBounds:
561 return rewriteValue386_OpPanicBounds(v)
562 case OpPanicExtend:
563 return rewriteValue386_OpPanicExtend(v)
564 case OpRotateLeft16:
565 v.Op = Op386ROLW
566 return true
567 case OpRotateLeft32:
568 v.Op = Op386ROLL
569 return true
570 case OpRotateLeft8:
571 v.Op = Op386ROLB
572 return true
573 case OpRound32F:
574 v.Op = OpCopy
575 return true
576 case OpRound64F:
577 v.Op = OpCopy
578 return true
579 case OpRsh16Ux16:
580 return rewriteValue386_OpRsh16Ux16(v)
581 case OpRsh16Ux32:
582 return rewriteValue386_OpRsh16Ux32(v)
583 case OpRsh16Ux64:
584 return rewriteValue386_OpRsh16Ux64(v)
585 case OpRsh16Ux8:
586 return rewriteValue386_OpRsh16Ux8(v)
587 case OpRsh16x16:
588 return rewriteValue386_OpRsh16x16(v)
589 case OpRsh16x32:
590 return rewriteValue386_OpRsh16x32(v)
591 case OpRsh16x64:
592 return rewriteValue386_OpRsh16x64(v)
593 case OpRsh16x8:
594 return rewriteValue386_OpRsh16x8(v)
595 case OpRsh32Ux16:
596 return rewriteValue386_OpRsh32Ux16(v)
597 case OpRsh32Ux32:
598 return rewriteValue386_OpRsh32Ux32(v)
599 case OpRsh32Ux64:
600 return rewriteValue386_OpRsh32Ux64(v)
601 case OpRsh32Ux8:
602 return rewriteValue386_OpRsh32Ux8(v)
603 case OpRsh32x16:
604 return rewriteValue386_OpRsh32x16(v)
605 case OpRsh32x32:
606 return rewriteValue386_OpRsh32x32(v)
607 case OpRsh32x64:
608 return rewriteValue386_OpRsh32x64(v)
609 case OpRsh32x8:
610 return rewriteValue386_OpRsh32x8(v)
611 case OpRsh8Ux16:
612 return rewriteValue386_OpRsh8Ux16(v)
613 case OpRsh8Ux32:
614 return rewriteValue386_OpRsh8Ux32(v)
615 case OpRsh8Ux64:
616 return rewriteValue386_OpRsh8Ux64(v)
617 case OpRsh8Ux8:
618 return rewriteValue386_OpRsh8Ux8(v)
619 case OpRsh8x16:
620 return rewriteValue386_OpRsh8x16(v)
621 case OpRsh8x32:
622 return rewriteValue386_OpRsh8x32(v)
623 case OpRsh8x64:
624 return rewriteValue386_OpRsh8x64(v)
625 case OpRsh8x8:
626 return rewriteValue386_OpRsh8x8(v)
627 case OpSelect0:
628 return rewriteValue386_OpSelect0(v)
629 case OpSelect1:
630 return rewriteValue386_OpSelect1(v)
631 case OpSignExt16to32:
632 v.Op = Op386MOVWLSX
633 return true
634 case OpSignExt8to16:
635 v.Op = Op386MOVBLSX
636 return true
637 case OpSignExt8to32:
638 v.Op = Op386MOVBLSX
639 return true
640 case OpSignmask:
641 return rewriteValue386_OpSignmask(v)
642 case OpSlicemask:
643 return rewriteValue386_OpSlicemask(v)
644 case OpSqrt:
645 v.Op = Op386SQRTSD
646 return true
647 case OpSqrt32:
648 v.Op = Op386SQRTSS
649 return true
650 case OpStaticCall:
651 v.Op = Op386CALLstatic
652 return true
653 case OpStore:
654 return rewriteValue386_OpStore(v)
655 case OpSub16:
656 v.Op = Op386SUBL
657 return true
658 case OpSub32:
659 v.Op = Op386SUBL
660 return true
661 case OpSub32F:
662 v.Op = Op386SUBSS
663 return true
664 case OpSub32carry:
665 v.Op = Op386SUBLcarry
666 return true
667 case OpSub32withcarry:
668 v.Op = Op386SBBL
669 return true
670 case OpSub64F:
671 v.Op = Op386SUBSD
672 return true
673 case OpSub8:
674 v.Op = Op386SUBL
675 return true
676 case OpSubPtr:
677 v.Op = Op386SUBL
678 return true
679 case OpTailCall:
680 v.Op = Op386CALLtail
681 return true
682 case OpTrunc16to8:
683 v.Op = OpCopy
684 return true
685 case OpTrunc32to16:
686 v.Op = OpCopy
687 return true
688 case OpTrunc32to8:
689 v.Op = OpCopy
690 return true
691 case OpWB:
692 v.Op = Op386LoweredWB
693 return true
694 case OpXor16:
695 v.Op = Op386XORL
696 return true
697 case OpXor32:
698 v.Op = Op386XORL
699 return true
700 case OpXor8:
701 v.Op = Op386XORL
702 return true
703 case OpZero:
704 return rewriteValue386_OpZero(v)
705 case OpZeroExt16to32:
706 v.Op = Op386MOVWLZX
707 return true
708 case OpZeroExt8to16:
709 v.Op = Op386MOVBLZX
710 return true
711 case OpZeroExt8to32:
712 v.Op = Op386MOVBLZX
713 return true
714 case OpZeromask:
715 return rewriteValue386_OpZeromask(v)
716 }
717 return false
718 }
719 func rewriteValue386_Op386ADCL(v *Value) bool {
720 v_2 := v.Args[2]
721 v_1 := v.Args[1]
722 v_0 := v.Args[0]
723
724
725 for {
726 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
727 x := v_0
728 if v_1.Op != Op386MOVLconst {
729 continue
730 }
731 c := auxIntToInt32(v_1.AuxInt)
732 f := v_2
733 v.reset(Op386ADCLconst)
734 v.AuxInt = int32ToAuxInt(c)
735 v.AddArg2(x, f)
736 return true
737 }
738 break
739 }
740 return false
741 }
742 func rewriteValue386_Op386ADDL(v *Value) bool {
743 v_1 := v.Args[1]
744 v_0 := v.Args[0]
745
746
747
748 for {
749 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
750 x := v_0
751 if v_1.Op != Op386MOVLconst {
752 continue
753 }
754 t := v_1.Type
755 c := auxIntToInt32(v_1.AuxInt)
756 if !(!t.IsPtr()) {
757 continue
758 }
759 v.reset(Op386ADDLconst)
760 v.AuxInt = int32ToAuxInt(c)
761 v.AddArg(x)
762 return true
763 }
764 break
765 }
766
767
768 for {
769 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
770 x := v_0
771 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
772 continue
773 }
774 y := v_1.Args[0]
775 v.reset(Op386LEAL8)
776 v.AddArg2(x, y)
777 return true
778 }
779 break
780 }
781
782
783 for {
784 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
785 x := v_0
786 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
787 continue
788 }
789 y := v_1.Args[0]
790 v.reset(Op386LEAL4)
791 v.AddArg2(x, y)
792 return true
793 }
794 break
795 }
796
797
798 for {
799 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
800 x := v_0
801 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
802 continue
803 }
804 y := v_1.Args[0]
805 v.reset(Op386LEAL2)
806 v.AddArg2(x, y)
807 return true
808 }
809 break
810 }
811
812
813 for {
814 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
815 x := v_0
816 if v_1.Op != Op386ADDL {
817 continue
818 }
819 y := v_1.Args[1]
820 if y != v_1.Args[0] {
821 continue
822 }
823 v.reset(Op386LEAL2)
824 v.AddArg2(x, y)
825 return true
826 }
827 break
828 }
829
830
831 for {
832 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
833 x := v_0
834 if v_1.Op != Op386ADDL {
835 continue
836 }
837 _ = v_1.Args[1]
838 v_1_0 := v_1.Args[0]
839 v_1_1 := v_1.Args[1]
840 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
841 if x != v_1_0 {
842 continue
843 }
844 y := v_1_1
845 v.reset(Op386LEAL2)
846 v.AddArg2(y, x)
847 return true
848 }
849 }
850 break
851 }
852
853
854 for {
855 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
856 if v_0.Op != Op386ADDLconst {
857 continue
858 }
859 c := auxIntToInt32(v_0.AuxInt)
860 x := v_0.Args[0]
861 y := v_1
862 v.reset(Op386LEAL1)
863 v.AuxInt = int32ToAuxInt(c)
864 v.AddArg2(x, y)
865 return true
866 }
867 break
868 }
869
870
871
872 for {
873 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
874 x := v_0
875 if v_1.Op != Op386LEAL {
876 continue
877 }
878 c := auxIntToInt32(v_1.AuxInt)
879 s := auxToSym(v_1.Aux)
880 y := v_1.Args[0]
881 if !(x.Op != OpSB && y.Op != OpSB) {
882 continue
883 }
884 v.reset(Op386LEAL1)
885 v.AuxInt = int32ToAuxInt(c)
886 v.Aux = symToAux(s)
887 v.AddArg2(x, y)
888 return true
889 }
890 break
891 }
892
893
894
895 for {
896 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
897 x := v_0
898 l := v_1
899 if l.Op != Op386MOVLload {
900 continue
901 }
902 off := auxIntToInt32(l.AuxInt)
903 sym := auxToSym(l.Aux)
904 mem := l.Args[1]
905 ptr := l.Args[0]
906 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
907 continue
908 }
909 v.reset(Op386ADDLload)
910 v.AuxInt = int32ToAuxInt(off)
911 v.Aux = symToAux(sym)
912 v.AddArg3(x, ptr, mem)
913 return true
914 }
915 break
916 }
917
918
919 for {
920 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
921 x := v_0
922 if v_1.Op != Op386NEGL {
923 continue
924 }
925 y := v_1.Args[0]
926 v.reset(Op386SUBL)
927 v.AddArg2(x, y)
928 return true
929 }
930 break
931 }
932 return false
933 }
934 func rewriteValue386_Op386ADDLcarry(v *Value) bool {
935 v_1 := v.Args[1]
936 v_0 := v.Args[0]
937
938
939 for {
940 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
941 x := v_0
942 if v_1.Op != Op386MOVLconst {
943 continue
944 }
945 c := auxIntToInt32(v_1.AuxInt)
946 v.reset(Op386ADDLconstcarry)
947 v.AuxInt = int32ToAuxInt(c)
948 v.AddArg(x)
949 return true
950 }
951 break
952 }
953 return false
954 }
955 func rewriteValue386_Op386ADDLconst(v *Value) bool {
956 v_0 := v.Args[0]
957
958
959 for {
960 c := auxIntToInt32(v.AuxInt)
961 if v_0.Op != Op386ADDL {
962 break
963 }
964 y := v_0.Args[1]
965 x := v_0.Args[0]
966 v.reset(Op386LEAL1)
967 v.AuxInt = int32ToAuxInt(c)
968 v.AddArg2(x, y)
969 return true
970 }
971
972
973
974 for {
975 c := auxIntToInt32(v.AuxInt)
976 if v_0.Op != Op386LEAL {
977 break
978 }
979 d := auxIntToInt32(v_0.AuxInt)
980 s := auxToSym(v_0.Aux)
981 x := v_0.Args[0]
982 if !(is32Bit(int64(c) + int64(d))) {
983 break
984 }
985 v.reset(Op386LEAL)
986 v.AuxInt = int32ToAuxInt(c + d)
987 v.Aux = symToAux(s)
988 v.AddArg(x)
989 return true
990 }
991
992
993 for {
994 c := auxIntToInt32(v.AuxInt)
995 x := v_0
996 if x.Op != OpSP {
997 break
998 }
999 v.reset(Op386LEAL)
1000 v.AuxInt = int32ToAuxInt(c)
1001 v.AddArg(x)
1002 return true
1003 }
1004
1005
1006
1007 for {
1008 c := auxIntToInt32(v.AuxInt)
1009 if v_0.Op != Op386LEAL1 {
1010 break
1011 }
1012 d := auxIntToInt32(v_0.AuxInt)
1013 s := auxToSym(v_0.Aux)
1014 y := v_0.Args[1]
1015 x := v_0.Args[0]
1016 if !(is32Bit(int64(c) + int64(d))) {
1017 break
1018 }
1019 v.reset(Op386LEAL1)
1020 v.AuxInt = int32ToAuxInt(c + d)
1021 v.Aux = symToAux(s)
1022 v.AddArg2(x, y)
1023 return true
1024 }
1025
1026
1027
1028 for {
1029 c := auxIntToInt32(v.AuxInt)
1030 if v_0.Op != Op386LEAL2 {
1031 break
1032 }
1033 d := auxIntToInt32(v_0.AuxInt)
1034 s := auxToSym(v_0.Aux)
1035 y := v_0.Args[1]
1036 x := v_0.Args[0]
1037 if !(is32Bit(int64(c) + int64(d))) {
1038 break
1039 }
1040 v.reset(Op386LEAL2)
1041 v.AuxInt = int32ToAuxInt(c + d)
1042 v.Aux = symToAux(s)
1043 v.AddArg2(x, y)
1044 return true
1045 }
1046
1047
1048
1049 for {
1050 c := auxIntToInt32(v.AuxInt)
1051 if v_0.Op != Op386LEAL4 {
1052 break
1053 }
1054 d := auxIntToInt32(v_0.AuxInt)
1055 s := auxToSym(v_0.Aux)
1056 y := v_0.Args[1]
1057 x := v_0.Args[0]
1058 if !(is32Bit(int64(c) + int64(d))) {
1059 break
1060 }
1061 v.reset(Op386LEAL4)
1062 v.AuxInt = int32ToAuxInt(c + d)
1063 v.Aux = symToAux(s)
1064 v.AddArg2(x, y)
1065 return true
1066 }
1067
1068
1069
1070 for {
1071 c := auxIntToInt32(v.AuxInt)
1072 if v_0.Op != Op386LEAL8 {
1073 break
1074 }
1075 d := auxIntToInt32(v_0.AuxInt)
1076 s := auxToSym(v_0.Aux)
1077 y := v_0.Args[1]
1078 x := v_0.Args[0]
1079 if !(is32Bit(int64(c) + int64(d))) {
1080 break
1081 }
1082 v.reset(Op386LEAL8)
1083 v.AuxInt = int32ToAuxInt(c + d)
1084 v.Aux = symToAux(s)
1085 v.AddArg2(x, y)
1086 return true
1087 }
1088
1089
1090
1091 for {
1092 c := auxIntToInt32(v.AuxInt)
1093 x := v_0
1094 if !(c == 0) {
1095 break
1096 }
1097 v.copyOf(x)
1098 return true
1099 }
1100
1101
1102 for {
1103 c := auxIntToInt32(v.AuxInt)
1104 if v_0.Op != Op386MOVLconst {
1105 break
1106 }
1107 d := auxIntToInt32(v_0.AuxInt)
1108 v.reset(Op386MOVLconst)
1109 v.AuxInt = int32ToAuxInt(c + d)
1110 return true
1111 }
1112
1113
1114 for {
1115 c := auxIntToInt32(v.AuxInt)
1116 if v_0.Op != Op386ADDLconst {
1117 break
1118 }
1119 d := auxIntToInt32(v_0.AuxInt)
1120 x := v_0.Args[0]
1121 v.reset(Op386ADDLconst)
1122 v.AuxInt = int32ToAuxInt(c + d)
1123 v.AddArg(x)
1124 return true
1125 }
1126 return false
1127 }
1128 func rewriteValue386_Op386ADDLconstmodify(v *Value) bool {
1129 v_1 := v.Args[1]
1130 v_0 := v.Args[0]
1131 b := v.Block
1132 config := b.Func.Config
1133
1134
1135
1136 for {
1137 valoff1 := auxIntToValAndOff(v.AuxInt)
1138 sym := auxToSym(v.Aux)
1139 if v_0.Op != Op386ADDLconst {
1140 break
1141 }
1142 off2 := auxIntToInt32(v_0.AuxInt)
1143 base := v_0.Args[0]
1144 mem := v_1
1145 if !(valoff1.canAdd32(off2)) {
1146 break
1147 }
1148 v.reset(Op386ADDLconstmodify)
1149 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1150 v.Aux = symToAux(sym)
1151 v.AddArg2(base, mem)
1152 return true
1153 }
1154
1155
1156
1157 for {
1158 valoff1 := auxIntToValAndOff(v.AuxInt)
1159 sym1 := auxToSym(v.Aux)
1160 if v_0.Op != Op386LEAL {
1161 break
1162 }
1163 off2 := auxIntToInt32(v_0.AuxInt)
1164 sym2 := auxToSym(v_0.Aux)
1165 base := v_0.Args[0]
1166 mem := v_1
1167 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1168 break
1169 }
1170 v.reset(Op386ADDLconstmodify)
1171 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1172 v.Aux = symToAux(mergeSym(sym1, sym2))
1173 v.AddArg2(base, mem)
1174 return true
1175 }
1176 return false
1177 }
1178 func rewriteValue386_Op386ADDLload(v *Value) bool {
1179 v_2 := v.Args[2]
1180 v_1 := v.Args[1]
1181 v_0 := v.Args[0]
1182 b := v.Block
1183 config := b.Func.Config
1184
1185
1186
1187 for {
1188 off1 := auxIntToInt32(v.AuxInt)
1189 sym := auxToSym(v.Aux)
1190 val := v_0
1191 if v_1.Op != Op386ADDLconst {
1192 break
1193 }
1194 off2 := auxIntToInt32(v_1.AuxInt)
1195 base := v_1.Args[0]
1196 mem := v_2
1197 if !(is32Bit(int64(off1) + int64(off2))) {
1198 break
1199 }
1200 v.reset(Op386ADDLload)
1201 v.AuxInt = int32ToAuxInt(off1 + off2)
1202 v.Aux = symToAux(sym)
1203 v.AddArg3(val, base, mem)
1204 return true
1205 }
1206
1207
1208
1209 for {
1210 off1 := auxIntToInt32(v.AuxInt)
1211 sym1 := auxToSym(v.Aux)
1212 val := v_0
1213 if v_1.Op != Op386LEAL {
1214 break
1215 }
1216 off2 := auxIntToInt32(v_1.AuxInt)
1217 sym2 := auxToSym(v_1.Aux)
1218 base := v_1.Args[0]
1219 mem := v_2
1220 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1221 break
1222 }
1223 v.reset(Op386ADDLload)
1224 v.AuxInt = int32ToAuxInt(off1 + off2)
1225 v.Aux = symToAux(mergeSym(sym1, sym2))
1226 v.AddArg3(val, base, mem)
1227 return true
1228 }
1229 return false
1230 }
1231 func rewriteValue386_Op386ADDLmodify(v *Value) bool {
1232 v_2 := v.Args[2]
1233 v_1 := v.Args[1]
1234 v_0 := v.Args[0]
1235 b := v.Block
1236 config := b.Func.Config
1237
1238
1239
1240 for {
1241 off1 := auxIntToInt32(v.AuxInt)
1242 sym := auxToSym(v.Aux)
1243 if v_0.Op != Op386ADDLconst {
1244 break
1245 }
1246 off2 := auxIntToInt32(v_0.AuxInt)
1247 base := v_0.Args[0]
1248 val := v_1
1249 mem := v_2
1250 if !(is32Bit(int64(off1) + int64(off2))) {
1251 break
1252 }
1253 v.reset(Op386ADDLmodify)
1254 v.AuxInt = int32ToAuxInt(off1 + off2)
1255 v.Aux = symToAux(sym)
1256 v.AddArg3(base, val, mem)
1257 return true
1258 }
1259
1260
1261
1262 for {
1263 off1 := auxIntToInt32(v.AuxInt)
1264 sym1 := auxToSym(v.Aux)
1265 if v_0.Op != Op386LEAL {
1266 break
1267 }
1268 off2 := auxIntToInt32(v_0.AuxInt)
1269 sym2 := auxToSym(v_0.Aux)
1270 base := v_0.Args[0]
1271 val := v_1
1272 mem := v_2
1273 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1274 break
1275 }
1276 v.reset(Op386ADDLmodify)
1277 v.AuxInt = int32ToAuxInt(off1 + off2)
1278 v.Aux = symToAux(mergeSym(sym1, sym2))
1279 v.AddArg3(base, val, mem)
1280 return true
1281 }
1282 return false
1283 }
1284 func rewriteValue386_Op386ADDSD(v *Value) bool {
1285 v_1 := v.Args[1]
1286 v_0 := v.Args[0]
1287
1288
1289
1290 for {
1291 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1292 x := v_0
1293 l := v_1
1294 if l.Op != Op386MOVSDload {
1295 continue
1296 }
1297 off := auxIntToInt32(l.AuxInt)
1298 sym := auxToSym(l.Aux)
1299 mem := l.Args[1]
1300 ptr := l.Args[0]
1301 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1302 continue
1303 }
1304 v.reset(Op386ADDSDload)
1305 v.AuxInt = int32ToAuxInt(off)
1306 v.Aux = symToAux(sym)
1307 v.AddArg3(x, ptr, mem)
1308 return true
1309 }
1310 break
1311 }
1312 return false
1313 }
1314 func rewriteValue386_Op386ADDSDload(v *Value) bool {
1315 v_2 := v.Args[2]
1316 v_1 := v.Args[1]
1317 v_0 := v.Args[0]
1318 b := v.Block
1319 config := b.Func.Config
1320
1321
1322
1323 for {
1324 off1 := auxIntToInt32(v.AuxInt)
1325 sym := auxToSym(v.Aux)
1326 val := v_0
1327 if v_1.Op != Op386ADDLconst {
1328 break
1329 }
1330 off2 := auxIntToInt32(v_1.AuxInt)
1331 base := v_1.Args[0]
1332 mem := v_2
1333 if !(is32Bit(int64(off1) + int64(off2))) {
1334 break
1335 }
1336 v.reset(Op386ADDSDload)
1337 v.AuxInt = int32ToAuxInt(off1 + off2)
1338 v.Aux = symToAux(sym)
1339 v.AddArg3(val, base, mem)
1340 return true
1341 }
1342
1343
1344
1345 for {
1346 off1 := auxIntToInt32(v.AuxInt)
1347 sym1 := auxToSym(v.Aux)
1348 val := v_0
1349 if v_1.Op != Op386LEAL {
1350 break
1351 }
1352 off2 := auxIntToInt32(v_1.AuxInt)
1353 sym2 := auxToSym(v_1.Aux)
1354 base := v_1.Args[0]
1355 mem := v_2
1356 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1357 break
1358 }
1359 v.reset(Op386ADDSDload)
1360 v.AuxInt = int32ToAuxInt(off1 + off2)
1361 v.Aux = symToAux(mergeSym(sym1, sym2))
1362 v.AddArg3(val, base, mem)
1363 return true
1364 }
1365 return false
1366 }
1367 func rewriteValue386_Op386ADDSS(v *Value) bool {
1368 v_1 := v.Args[1]
1369 v_0 := v.Args[0]
1370
1371
1372
1373 for {
1374 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1375 x := v_0
1376 l := v_1
1377 if l.Op != Op386MOVSSload {
1378 continue
1379 }
1380 off := auxIntToInt32(l.AuxInt)
1381 sym := auxToSym(l.Aux)
1382 mem := l.Args[1]
1383 ptr := l.Args[0]
1384 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1385 continue
1386 }
1387 v.reset(Op386ADDSSload)
1388 v.AuxInt = int32ToAuxInt(off)
1389 v.Aux = symToAux(sym)
1390 v.AddArg3(x, ptr, mem)
1391 return true
1392 }
1393 break
1394 }
1395 return false
1396 }
1397 func rewriteValue386_Op386ADDSSload(v *Value) bool {
1398 v_2 := v.Args[2]
1399 v_1 := v.Args[1]
1400 v_0 := v.Args[0]
1401 b := v.Block
1402 config := b.Func.Config
1403
1404
1405
1406 for {
1407 off1 := auxIntToInt32(v.AuxInt)
1408 sym := auxToSym(v.Aux)
1409 val := v_0
1410 if v_1.Op != Op386ADDLconst {
1411 break
1412 }
1413 off2 := auxIntToInt32(v_1.AuxInt)
1414 base := v_1.Args[0]
1415 mem := v_2
1416 if !(is32Bit(int64(off1) + int64(off2))) {
1417 break
1418 }
1419 v.reset(Op386ADDSSload)
1420 v.AuxInt = int32ToAuxInt(off1 + off2)
1421 v.Aux = symToAux(sym)
1422 v.AddArg3(val, base, mem)
1423 return true
1424 }
1425
1426
1427
1428 for {
1429 off1 := auxIntToInt32(v.AuxInt)
1430 sym1 := auxToSym(v.Aux)
1431 val := v_0
1432 if v_1.Op != Op386LEAL {
1433 break
1434 }
1435 off2 := auxIntToInt32(v_1.AuxInt)
1436 sym2 := auxToSym(v_1.Aux)
1437 base := v_1.Args[0]
1438 mem := v_2
1439 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1440 break
1441 }
1442 v.reset(Op386ADDSSload)
1443 v.AuxInt = int32ToAuxInt(off1 + off2)
1444 v.Aux = symToAux(mergeSym(sym1, sym2))
1445 v.AddArg3(val, base, mem)
1446 return true
1447 }
1448 return false
1449 }
1450 func rewriteValue386_Op386ANDL(v *Value) bool {
1451 v_1 := v.Args[1]
1452 v_0 := v.Args[0]
1453
1454
1455 for {
1456 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1457 x := v_0
1458 if v_1.Op != Op386MOVLconst {
1459 continue
1460 }
1461 c := auxIntToInt32(v_1.AuxInt)
1462 v.reset(Op386ANDLconst)
1463 v.AuxInt = int32ToAuxInt(c)
1464 v.AddArg(x)
1465 return true
1466 }
1467 break
1468 }
1469
1470
1471
1472 for {
1473 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1474 x := v_0
1475 l := v_1
1476 if l.Op != Op386MOVLload {
1477 continue
1478 }
1479 off := auxIntToInt32(l.AuxInt)
1480 sym := auxToSym(l.Aux)
1481 mem := l.Args[1]
1482 ptr := l.Args[0]
1483 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1484 continue
1485 }
1486 v.reset(Op386ANDLload)
1487 v.AuxInt = int32ToAuxInt(off)
1488 v.Aux = symToAux(sym)
1489 v.AddArg3(x, ptr, mem)
1490 return true
1491 }
1492 break
1493 }
1494
1495
1496 for {
1497 x := v_0
1498 if x != v_1 {
1499 break
1500 }
1501 v.copyOf(x)
1502 return true
1503 }
1504 return false
1505 }
1506 func rewriteValue386_Op386ANDLconst(v *Value) bool {
1507 v_0 := v.Args[0]
1508
1509
1510 for {
1511 c := auxIntToInt32(v.AuxInt)
1512 if v_0.Op != Op386ANDLconst {
1513 break
1514 }
1515 d := auxIntToInt32(v_0.AuxInt)
1516 x := v_0.Args[0]
1517 v.reset(Op386ANDLconst)
1518 v.AuxInt = int32ToAuxInt(c & d)
1519 v.AddArg(x)
1520 return true
1521 }
1522
1523
1524
1525 for {
1526 c := auxIntToInt32(v.AuxInt)
1527 if !(c == 0) {
1528 break
1529 }
1530 v.reset(Op386MOVLconst)
1531 v.AuxInt = int32ToAuxInt(0)
1532 return true
1533 }
1534
1535
1536
1537 for {
1538 c := auxIntToInt32(v.AuxInt)
1539 x := v_0
1540 if !(c == -1) {
1541 break
1542 }
1543 v.copyOf(x)
1544 return true
1545 }
1546
1547
1548 for {
1549 c := auxIntToInt32(v.AuxInt)
1550 if v_0.Op != Op386MOVLconst {
1551 break
1552 }
1553 d := auxIntToInt32(v_0.AuxInt)
1554 v.reset(Op386MOVLconst)
1555 v.AuxInt = int32ToAuxInt(c & d)
1556 return true
1557 }
1558 return false
1559 }
1560 func rewriteValue386_Op386ANDLconstmodify(v *Value) bool {
1561 v_1 := v.Args[1]
1562 v_0 := v.Args[0]
1563 b := v.Block
1564 config := b.Func.Config
1565
1566
1567
1568 for {
1569 valoff1 := auxIntToValAndOff(v.AuxInt)
1570 sym := auxToSym(v.Aux)
1571 if v_0.Op != Op386ADDLconst {
1572 break
1573 }
1574 off2 := auxIntToInt32(v_0.AuxInt)
1575 base := v_0.Args[0]
1576 mem := v_1
1577 if !(valoff1.canAdd32(off2)) {
1578 break
1579 }
1580 v.reset(Op386ANDLconstmodify)
1581 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1582 v.Aux = symToAux(sym)
1583 v.AddArg2(base, mem)
1584 return true
1585 }
1586
1587
1588
1589 for {
1590 valoff1 := auxIntToValAndOff(v.AuxInt)
1591 sym1 := auxToSym(v.Aux)
1592 if v_0.Op != Op386LEAL {
1593 break
1594 }
1595 off2 := auxIntToInt32(v_0.AuxInt)
1596 sym2 := auxToSym(v_0.Aux)
1597 base := v_0.Args[0]
1598 mem := v_1
1599 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1600 break
1601 }
1602 v.reset(Op386ANDLconstmodify)
1603 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1604 v.Aux = symToAux(mergeSym(sym1, sym2))
1605 v.AddArg2(base, mem)
1606 return true
1607 }
1608 return false
1609 }
1610 func rewriteValue386_Op386ANDLload(v *Value) bool {
1611 v_2 := v.Args[2]
1612 v_1 := v.Args[1]
1613 v_0 := v.Args[0]
1614 b := v.Block
1615 config := b.Func.Config
1616
1617
1618
1619 for {
1620 off1 := auxIntToInt32(v.AuxInt)
1621 sym := auxToSym(v.Aux)
1622 val := v_0
1623 if v_1.Op != Op386ADDLconst {
1624 break
1625 }
1626 off2 := auxIntToInt32(v_1.AuxInt)
1627 base := v_1.Args[0]
1628 mem := v_2
1629 if !(is32Bit(int64(off1) + int64(off2))) {
1630 break
1631 }
1632 v.reset(Op386ANDLload)
1633 v.AuxInt = int32ToAuxInt(off1 + off2)
1634 v.Aux = symToAux(sym)
1635 v.AddArg3(val, base, mem)
1636 return true
1637 }
1638
1639
1640
1641 for {
1642 off1 := auxIntToInt32(v.AuxInt)
1643 sym1 := auxToSym(v.Aux)
1644 val := v_0
1645 if v_1.Op != Op386LEAL {
1646 break
1647 }
1648 off2 := auxIntToInt32(v_1.AuxInt)
1649 sym2 := auxToSym(v_1.Aux)
1650 base := v_1.Args[0]
1651 mem := v_2
1652 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1653 break
1654 }
1655 v.reset(Op386ANDLload)
1656 v.AuxInt = int32ToAuxInt(off1 + off2)
1657 v.Aux = symToAux(mergeSym(sym1, sym2))
1658 v.AddArg3(val, base, mem)
1659 return true
1660 }
1661 return false
1662 }
1663 func rewriteValue386_Op386ANDLmodify(v *Value) bool {
1664 v_2 := v.Args[2]
1665 v_1 := v.Args[1]
1666 v_0 := v.Args[0]
1667 b := v.Block
1668 config := b.Func.Config
1669
1670
1671
1672 for {
1673 off1 := auxIntToInt32(v.AuxInt)
1674 sym := auxToSym(v.Aux)
1675 if v_0.Op != Op386ADDLconst {
1676 break
1677 }
1678 off2 := auxIntToInt32(v_0.AuxInt)
1679 base := v_0.Args[0]
1680 val := v_1
1681 mem := v_2
1682 if !(is32Bit(int64(off1) + int64(off2))) {
1683 break
1684 }
1685 v.reset(Op386ANDLmodify)
1686 v.AuxInt = int32ToAuxInt(off1 + off2)
1687 v.Aux = symToAux(sym)
1688 v.AddArg3(base, val, mem)
1689 return true
1690 }
1691
1692
1693
1694 for {
1695 off1 := auxIntToInt32(v.AuxInt)
1696 sym1 := auxToSym(v.Aux)
1697 if v_0.Op != Op386LEAL {
1698 break
1699 }
1700 off2 := auxIntToInt32(v_0.AuxInt)
1701 sym2 := auxToSym(v_0.Aux)
1702 base := v_0.Args[0]
1703 val := v_1
1704 mem := v_2
1705 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1706 break
1707 }
1708 v.reset(Op386ANDLmodify)
1709 v.AuxInt = int32ToAuxInt(off1 + off2)
1710 v.Aux = symToAux(mergeSym(sym1, sym2))
1711 v.AddArg3(base, val, mem)
1712 return true
1713 }
1714 return false
1715 }
1716 func rewriteValue386_Op386CMPB(v *Value) bool {
1717 v_1 := v.Args[1]
1718 v_0 := v.Args[0]
1719 b := v.Block
1720
1721
1722 for {
1723 x := v_0
1724 if v_1.Op != Op386MOVLconst {
1725 break
1726 }
1727 c := auxIntToInt32(v_1.AuxInt)
1728 v.reset(Op386CMPBconst)
1729 v.AuxInt = int8ToAuxInt(int8(c))
1730 v.AddArg(x)
1731 return true
1732 }
1733
1734
1735 for {
1736 if v_0.Op != Op386MOVLconst {
1737 break
1738 }
1739 c := auxIntToInt32(v_0.AuxInt)
1740 x := v_1
1741 v.reset(Op386InvertFlags)
1742 v0 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
1743 v0.AuxInt = int8ToAuxInt(int8(c))
1744 v0.AddArg(x)
1745 v.AddArg(v0)
1746 return true
1747 }
1748
1749
1750
1751 for {
1752 x := v_0
1753 y := v_1
1754 if !(canonLessThan(x, y)) {
1755 break
1756 }
1757 v.reset(Op386InvertFlags)
1758 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
1759 v0.AddArg2(y, x)
1760 v.AddArg(v0)
1761 return true
1762 }
1763
1764
1765
1766 for {
1767 l := v_0
1768 if l.Op != Op386MOVBload {
1769 break
1770 }
1771 off := auxIntToInt32(l.AuxInt)
1772 sym := auxToSym(l.Aux)
1773 mem := l.Args[1]
1774 ptr := l.Args[0]
1775 x := v_1
1776 if !(canMergeLoad(v, l) && clobber(l)) {
1777 break
1778 }
1779 v.reset(Op386CMPBload)
1780 v.AuxInt = int32ToAuxInt(off)
1781 v.Aux = symToAux(sym)
1782 v.AddArg3(ptr, x, mem)
1783 return true
1784 }
1785
1786
1787
1788 for {
1789 x := v_0
1790 l := v_1
1791 if l.Op != Op386MOVBload {
1792 break
1793 }
1794 off := auxIntToInt32(l.AuxInt)
1795 sym := auxToSym(l.Aux)
1796 mem := l.Args[1]
1797 ptr := l.Args[0]
1798 if !(canMergeLoad(v, l) && clobber(l)) {
1799 break
1800 }
1801 v.reset(Op386InvertFlags)
1802 v0 := b.NewValue0(l.Pos, Op386CMPBload, types.TypeFlags)
1803 v0.AuxInt = int32ToAuxInt(off)
1804 v0.Aux = symToAux(sym)
1805 v0.AddArg3(ptr, x, mem)
1806 v.AddArg(v0)
1807 return true
1808 }
1809 return false
1810 }
1811 func rewriteValue386_Op386CMPBconst(v *Value) bool {
1812 v_0 := v.Args[0]
1813 b := v.Block
1814
1815
1816
1817 for {
1818 y := auxIntToInt8(v.AuxInt)
1819 if v_0.Op != Op386MOVLconst {
1820 break
1821 }
1822 x := auxIntToInt32(v_0.AuxInt)
1823 if !(int8(x) == y) {
1824 break
1825 }
1826 v.reset(Op386FlagEQ)
1827 return true
1828 }
1829
1830
1831
1832 for {
1833 y := auxIntToInt8(v.AuxInt)
1834 if v_0.Op != Op386MOVLconst {
1835 break
1836 }
1837 x := auxIntToInt32(v_0.AuxInt)
1838 if !(int8(x) < y && uint8(x) < uint8(y)) {
1839 break
1840 }
1841 v.reset(Op386FlagLT_ULT)
1842 return true
1843 }
1844
1845
1846
1847 for {
1848 y := auxIntToInt8(v.AuxInt)
1849 if v_0.Op != Op386MOVLconst {
1850 break
1851 }
1852 x := auxIntToInt32(v_0.AuxInt)
1853 if !(int8(x) < y && uint8(x) > uint8(y)) {
1854 break
1855 }
1856 v.reset(Op386FlagLT_UGT)
1857 return true
1858 }
1859
1860
1861
1862 for {
1863 y := auxIntToInt8(v.AuxInt)
1864 if v_0.Op != Op386MOVLconst {
1865 break
1866 }
1867 x := auxIntToInt32(v_0.AuxInt)
1868 if !(int8(x) > y && uint8(x) < uint8(y)) {
1869 break
1870 }
1871 v.reset(Op386FlagGT_ULT)
1872 return true
1873 }
1874
1875
1876
1877 for {
1878 y := auxIntToInt8(v.AuxInt)
1879 if v_0.Op != Op386MOVLconst {
1880 break
1881 }
1882 x := auxIntToInt32(v_0.AuxInt)
1883 if !(int8(x) > y && uint8(x) > uint8(y)) {
1884 break
1885 }
1886 v.reset(Op386FlagGT_UGT)
1887 return true
1888 }
1889
1890
1891
1892 for {
1893 n := auxIntToInt8(v.AuxInt)
1894 if v_0.Op != Op386ANDLconst {
1895 break
1896 }
1897 m := auxIntToInt32(v_0.AuxInt)
1898 if !(0 <= int8(m) && int8(m) < n) {
1899 break
1900 }
1901 v.reset(Op386FlagLT_ULT)
1902 return true
1903 }
1904
1905
1906
1907 for {
1908 if auxIntToInt8(v.AuxInt) != 0 {
1909 break
1910 }
1911 l := v_0
1912 if l.Op != Op386ANDL {
1913 break
1914 }
1915 y := l.Args[1]
1916 x := l.Args[0]
1917 if !(l.Uses == 1) {
1918 break
1919 }
1920 v.reset(Op386TESTB)
1921 v.AddArg2(x, y)
1922 return true
1923 }
1924
1925
1926
1927 for {
1928 if auxIntToInt8(v.AuxInt) != 0 {
1929 break
1930 }
1931 l := v_0
1932 if l.Op != Op386ANDLconst {
1933 break
1934 }
1935 c := auxIntToInt32(l.AuxInt)
1936 x := l.Args[0]
1937 if !(l.Uses == 1) {
1938 break
1939 }
1940 v.reset(Op386TESTBconst)
1941 v.AuxInt = int8ToAuxInt(int8(c))
1942 v.AddArg(x)
1943 return true
1944 }
1945
1946
1947 for {
1948 if auxIntToInt8(v.AuxInt) != 0 {
1949 break
1950 }
1951 x := v_0
1952 v.reset(Op386TESTB)
1953 v.AddArg2(x, x)
1954 return true
1955 }
1956
1957
1958
1959 for {
1960 c := auxIntToInt8(v.AuxInt)
1961 l := v_0
1962 if l.Op != Op386MOVBload {
1963 break
1964 }
1965 off := auxIntToInt32(l.AuxInt)
1966 sym := auxToSym(l.Aux)
1967 mem := l.Args[1]
1968 ptr := l.Args[0]
1969 if !(l.Uses == 1 && clobber(l)) {
1970 break
1971 }
1972 b = l.Block
1973 v0 := b.NewValue0(l.Pos, Op386CMPBconstload, types.TypeFlags)
1974 v.copyOf(v0)
1975 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
1976 v0.Aux = symToAux(sym)
1977 v0.AddArg2(ptr, mem)
1978 return true
1979 }
1980 return false
1981 }
1982 func rewriteValue386_Op386CMPBload(v *Value) bool {
1983 v_2 := v.Args[2]
1984 v_1 := v.Args[1]
1985 v_0 := v.Args[0]
1986
1987
1988 for {
1989 off := auxIntToInt32(v.AuxInt)
1990 sym := auxToSym(v.Aux)
1991 ptr := v_0
1992 if v_1.Op != Op386MOVLconst {
1993 break
1994 }
1995 c := auxIntToInt32(v_1.AuxInt)
1996 mem := v_2
1997 v.reset(Op386CMPBconstload)
1998 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int8(c)), off))
1999 v.Aux = symToAux(sym)
2000 v.AddArg2(ptr, mem)
2001 return true
2002 }
2003 return false
2004 }
2005 func rewriteValue386_Op386CMPL(v *Value) bool {
2006 v_1 := v.Args[1]
2007 v_0 := v.Args[0]
2008 b := v.Block
2009
2010
2011 for {
2012 x := v_0
2013 if v_1.Op != Op386MOVLconst {
2014 break
2015 }
2016 c := auxIntToInt32(v_1.AuxInt)
2017 v.reset(Op386CMPLconst)
2018 v.AuxInt = int32ToAuxInt(c)
2019 v.AddArg(x)
2020 return true
2021 }
2022
2023
2024 for {
2025 if v_0.Op != Op386MOVLconst {
2026 break
2027 }
2028 c := auxIntToInt32(v_0.AuxInt)
2029 x := v_1
2030 v.reset(Op386InvertFlags)
2031 v0 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
2032 v0.AuxInt = int32ToAuxInt(c)
2033 v0.AddArg(x)
2034 v.AddArg(v0)
2035 return true
2036 }
2037
2038
2039
2040 for {
2041 x := v_0
2042 y := v_1
2043 if !(canonLessThan(x, y)) {
2044 break
2045 }
2046 v.reset(Op386InvertFlags)
2047 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
2048 v0.AddArg2(y, x)
2049 v.AddArg(v0)
2050 return true
2051 }
2052
2053
2054
2055 for {
2056 l := v_0
2057 if l.Op != Op386MOVLload {
2058 break
2059 }
2060 off := auxIntToInt32(l.AuxInt)
2061 sym := auxToSym(l.Aux)
2062 mem := l.Args[1]
2063 ptr := l.Args[0]
2064 x := v_1
2065 if !(canMergeLoad(v, l) && clobber(l)) {
2066 break
2067 }
2068 v.reset(Op386CMPLload)
2069 v.AuxInt = int32ToAuxInt(off)
2070 v.Aux = symToAux(sym)
2071 v.AddArg3(ptr, x, mem)
2072 return true
2073 }
2074
2075
2076
2077 for {
2078 x := v_0
2079 l := v_1
2080 if l.Op != Op386MOVLload {
2081 break
2082 }
2083 off := auxIntToInt32(l.AuxInt)
2084 sym := auxToSym(l.Aux)
2085 mem := l.Args[1]
2086 ptr := l.Args[0]
2087 if !(canMergeLoad(v, l) && clobber(l)) {
2088 break
2089 }
2090 v.reset(Op386InvertFlags)
2091 v0 := b.NewValue0(l.Pos, Op386CMPLload, types.TypeFlags)
2092 v0.AuxInt = int32ToAuxInt(off)
2093 v0.Aux = symToAux(sym)
2094 v0.AddArg3(ptr, x, mem)
2095 v.AddArg(v0)
2096 return true
2097 }
2098 return false
2099 }
2100 func rewriteValue386_Op386CMPLconst(v *Value) bool {
2101 v_0 := v.Args[0]
2102 b := v.Block
2103
2104
2105
2106 for {
2107 y := auxIntToInt32(v.AuxInt)
2108 if v_0.Op != Op386MOVLconst {
2109 break
2110 }
2111 x := auxIntToInt32(v_0.AuxInt)
2112 if !(x == y) {
2113 break
2114 }
2115 v.reset(Op386FlagEQ)
2116 return true
2117 }
2118
2119
2120
2121 for {
2122 y := auxIntToInt32(v.AuxInt)
2123 if v_0.Op != Op386MOVLconst {
2124 break
2125 }
2126 x := auxIntToInt32(v_0.AuxInt)
2127 if !(x < y && uint32(x) < uint32(y)) {
2128 break
2129 }
2130 v.reset(Op386FlagLT_ULT)
2131 return true
2132 }
2133
2134
2135
2136 for {
2137 y := auxIntToInt32(v.AuxInt)
2138 if v_0.Op != Op386MOVLconst {
2139 break
2140 }
2141 x := auxIntToInt32(v_0.AuxInt)
2142 if !(x < y && uint32(x) > uint32(y)) {
2143 break
2144 }
2145 v.reset(Op386FlagLT_UGT)
2146 return true
2147 }
2148
2149
2150
2151 for {
2152 y := auxIntToInt32(v.AuxInt)
2153 if v_0.Op != Op386MOVLconst {
2154 break
2155 }
2156 x := auxIntToInt32(v_0.AuxInt)
2157 if !(x > y && uint32(x) < uint32(y)) {
2158 break
2159 }
2160 v.reset(Op386FlagGT_ULT)
2161 return true
2162 }
2163
2164
2165
2166 for {
2167 y := auxIntToInt32(v.AuxInt)
2168 if v_0.Op != Op386MOVLconst {
2169 break
2170 }
2171 x := auxIntToInt32(v_0.AuxInt)
2172 if !(x > y && uint32(x) > uint32(y)) {
2173 break
2174 }
2175 v.reset(Op386FlagGT_UGT)
2176 return true
2177 }
2178
2179
2180
2181 for {
2182 n := auxIntToInt32(v.AuxInt)
2183 if v_0.Op != Op386SHRLconst {
2184 break
2185 }
2186 c := auxIntToInt32(v_0.AuxInt)
2187 if !(0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)) {
2188 break
2189 }
2190 v.reset(Op386FlagLT_ULT)
2191 return true
2192 }
2193
2194
2195
2196 for {
2197 n := auxIntToInt32(v.AuxInt)
2198 if v_0.Op != Op386ANDLconst {
2199 break
2200 }
2201 m := auxIntToInt32(v_0.AuxInt)
2202 if !(0 <= m && m < n) {
2203 break
2204 }
2205 v.reset(Op386FlagLT_ULT)
2206 return true
2207 }
2208
2209
2210
2211 for {
2212 if auxIntToInt32(v.AuxInt) != 0 {
2213 break
2214 }
2215 l := v_0
2216 if l.Op != Op386ANDL {
2217 break
2218 }
2219 y := l.Args[1]
2220 x := l.Args[0]
2221 if !(l.Uses == 1) {
2222 break
2223 }
2224 v.reset(Op386TESTL)
2225 v.AddArg2(x, y)
2226 return true
2227 }
2228
2229
2230
2231 for {
2232 if auxIntToInt32(v.AuxInt) != 0 {
2233 break
2234 }
2235 l := v_0
2236 if l.Op != Op386ANDLconst {
2237 break
2238 }
2239 c := auxIntToInt32(l.AuxInt)
2240 x := l.Args[0]
2241 if !(l.Uses == 1) {
2242 break
2243 }
2244 v.reset(Op386TESTLconst)
2245 v.AuxInt = int32ToAuxInt(c)
2246 v.AddArg(x)
2247 return true
2248 }
2249
2250
2251 for {
2252 if auxIntToInt32(v.AuxInt) != 0 {
2253 break
2254 }
2255 x := v_0
2256 v.reset(Op386TESTL)
2257 v.AddArg2(x, x)
2258 return true
2259 }
2260
2261
2262
2263 for {
2264 c := auxIntToInt32(v.AuxInt)
2265 l := v_0
2266 if l.Op != Op386MOVLload {
2267 break
2268 }
2269 off := auxIntToInt32(l.AuxInt)
2270 sym := auxToSym(l.Aux)
2271 mem := l.Args[1]
2272 ptr := l.Args[0]
2273 if !(l.Uses == 1 && clobber(l)) {
2274 break
2275 }
2276 b = l.Block
2277 v0 := b.NewValue0(l.Pos, Op386CMPLconstload, types.TypeFlags)
2278 v.copyOf(v0)
2279 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2280 v0.Aux = symToAux(sym)
2281 v0.AddArg2(ptr, mem)
2282 return true
2283 }
2284 return false
2285 }
2286 func rewriteValue386_Op386CMPLload(v *Value) bool {
2287 v_2 := v.Args[2]
2288 v_1 := v.Args[1]
2289 v_0 := v.Args[0]
2290
2291
2292 for {
2293 off := auxIntToInt32(v.AuxInt)
2294 sym := auxToSym(v.Aux)
2295 ptr := v_0
2296 if v_1.Op != Op386MOVLconst {
2297 break
2298 }
2299 c := auxIntToInt32(v_1.AuxInt)
2300 mem := v_2
2301 v.reset(Op386CMPLconstload)
2302 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
2303 v.Aux = symToAux(sym)
2304 v.AddArg2(ptr, mem)
2305 return true
2306 }
2307 return false
2308 }
2309 func rewriteValue386_Op386CMPW(v *Value) bool {
2310 v_1 := v.Args[1]
2311 v_0 := v.Args[0]
2312 b := v.Block
2313
2314
2315 for {
2316 x := v_0
2317 if v_1.Op != Op386MOVLconst {
2318 break
2319 }
2320 c := auxIntToInt32(v_1.AuxInt)
2321 v.reset(Op386CMPWconst)
2322 v.AuxInt = int16ToAuxInt(int16(c))
2323 v.AddArg(x)
2324 return true
2325 }
2326
2327
2328 for {
2329 if v_0.Op != Op386MOVLconst {
2330 break
2331 }
2332 c := auxIntToInt32(v_0.AuxInt)
2333 x := v_1
2334 v.reset(Op386InvertFlags)
2335 v0 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
2336 v0.AuxInt = int16ToAuxInt(int16(c))
2337 v0.AddArg(x)
2338 v.AddArg(v0)
2339 return true
2340 }
2341
2342
2343
2344 for {
2345 x := v_0
2346 y := v_1
2347 if !(canonLessThan(x, y)) {
2348 break
2349 }
2350 v.reset(Op386InvertFlags)
2351 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
2352 v0.AddArg2(y, x)
2353 v.AddArg(v0)
2354 return true
2355 }
2356
2357
2358
2359 for {
2360 l := v_0
2361 if l.Op != Op386MOVWload {
2362 break
2363 }
2364 off := auxIntToInt32(l.AuxInt)
2365 sym := auxToSym(l.Aux)
2366 mem := l.Args[1]
2367 ptr := l.Args[0]
2368 x := v_1
2369 if !(canMergeLoad(v, l) && clobber(l)) {
2370 break
2371 }
2372 v.reset(Op386CMPWload)
2373 v.AuxInt = int32ToAuxInt(off)
2374 v.Aux = symToAux(sym)
2375 v.AddArg3(ptr, x, mem)
2376 return true
2377 }
2378
2379
2380
2381 for {
2382 x := v_0
2383 l := v_1
2384 if l.Op != Op386MOVWload {
2385 break
2386 }
2387 off := auxIntToInt32(l.AuxInt)
2388 sym := auxToSym(l.Aux)
2389 mem := l.Args[1]
2390 ptr := l.Args[0]
2391 if !(canMergeLoad(v, l) && clobber(l)) {
2392 break
2393 }
2394 v.reset(Op386InvertFlags)
2395 v0 := b.NewValue0(l.Pos, Op386CMPWload, types.TypeFlags)
2396 v0.AuxInt = int32ToAuxInt(off)
2397 v0.Aux = symToAux(sym)
2398 v0.AddArg3(ptr, x, mem)
2399 v.AddArg(v0)
2400 return true
2401 }
2402 return false
2403 }
2404 func rewriteValue386_Op386CMPWconst(v *Value) bool {
2405 v_0 := v.Args[0]
2406 b := v.Block
2407
2408
2409
2410 for {
2411 y := auxIntToInt16(v.AuxInt)
2412 if v_0.Op != Op386MOVLconst {
2413 break
2414 }
2415 x := auxIntToInt32(v_0.AuxInt)
2416 if !(int16(x) == y) {
2417 break
2418 }
2419 v.reset(Op386FlagEQ)
2420 return true
2421 }
2422
2423
2424
2425 for {
2426 y := auxIntToInt16(v.AuxInt)
2427 if v_0.Op != Op386MOVLconst {
2428 break
2429 }
2430 x := auxIntToInt32(v_0.AuxInt)
2431 if !(int16(x) < y && uint16(x) < uint16(y)) {
2432 break
2433 }
2434 v.reset(Op386FlagLT_ULT)
2435 return true
2436 }
2437
2438
2439
2440 for {
2441 y := auxIntToInt16(v.AuxInt)
2442 if v_0.Op != Op386MOVLconst {
2443 break
2444 }
2445 x := auxIntToInt32(v_0.AuxInt)
2446 if !(int16(x) < y && uint16(x) > uint16(y)) {
2447 break
2448 }
2449 v.reset(Op386FlagLT_UGT)
2450 return true
2451 }
2452
2453
2454
2455 for {
2456 y := auxIntToInt16(v.AuxInt)
2457 if v_0.Op != Op386MOVLconst {
2458 break
2459 }
2460 x := auxIntToInt32(v_0.AuxInt)
2461 if !(int16(x) > y && uint16(x) < uint16(y)) {
2462 break
2463 }
2464 v.reset(Op386FlagGT_ULT)
2465 return true
2466 }
2467
2468
2469
2470 for {
2471 y := auxIntToInt16(v.AuxInt)
2472 if v_0.Op != Op386MOVLconst {
2473 break
2474 }
2475 x := auxIntToInt32(v_0.AuxInt)
2476 if !(int16(x) > y && uint16(x) > uint16(y)) {
2477 break
2478 }
2479 v.reset(Op386FlagGT_UGT)
2480 return true
2481 }
2482
2483
2484
2485 for {
2486 n := auxIntToInt16(v.AuxInt)
2487 if v_0.Op != Op386ANDLconst {
2488 break
2489 }
2490 m := auxIntToInt32(v_0.AuxInt)
2491 if !(0 <= int16(m) && int16(m) < n) {
2492 break
2493 }
2494 v.reset(Op386FlagLT_ULT)
2495 return true
2496 }
2497
2498
2499
2500 for {
2501 if auxIntToInt16(v.AuxInt) != 0 {
2502 break
2503 }
2504 l := v_0
2505 if l.Op != Op386ANDL {
2506 break
2507 }
2508 y := l.Args[1]
2509 x := l.Args[0]
2510 if !(l.Uses == 1) {
2511 break
2512 }
2513 v.reset(Op386TESTW)
2514 v.AddArg2(x, y)
2515 return true
2516 }
2517
2518
2519
2520 for {
2521 if auxIntToInt16(v.AuxInt) != 0 {
2522 break
2523 }
2524 l := v_0
2525 if l.Op != Op386ANDLconst {
2526 break
2527 }
2528 c := auxIntToInt32(l.AuxInt)
2529 x := l.Args[0]
2530 if !(l.Uses == 1) {
2531 break
2532 }
2533 v.reset(Op386TESTWconst)
2534 v.AuxInt = int16ToAuxInt(int16(c))
2535 v.AddArg(x)
2536 return true
2537 }
2538
2539
2540 for {
2541 if auxIntToInt16(v.AuxInt) != 0 {
2542 break
2543 }
2544 x := v_0
2545 v.reset(Op386TESTW)
2546 v.AddArg2(x, x)
2547 return true
2548 }
2549
2550
2551
2552 for {
2553 c := auxIntToInt16(v.AuxInt)
2554 l := v_0
2555 if l.Op != Op386MOVWload {
2556 break
2557 }
2558 off := auxIntToInt32(l.AuxInt)
2559 sym := auxToSym(l.Aux)
2560 mem := l.Args[1]
2561 ptr := l.Args[0]
2562 if !(l.Uses == 1 && clobber(l)) {
2563 break
2564 }
2565 b = l.Block
2566 v0 := b.NewValue0(l.Pos, Op386CMPWconstload, types.TypeFlags)
2567 v.copyOf(v0)
2568 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2569 v0.Aux = symToAux(sym)
2570 v0.AddArg2(ptr, mem)
2571 return true
2572 }
2573 return false
2574 }
2575 func rewriteValue386_Op386CMPWload(v *Value) bool {
2576 v_2 := v.Args[2]
2577 v_1 := v.Args[1]
2578 v_0 := v.Args[0]
2579
2580
2581 for {
2582 off := auxIntToInt32(v.AuxInt)
2583 sym := auxToSym(v.Aux)
2584 ptr := v_0
2585 if v_1.Op != Op386MOVLconst {
2586 break
2587 }
2588 c := auxIntToInt32(v_1.AuxInt)
2589 mem := v_2
2590 v.reset(Op386CMPWconstload)
2591 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int16(c)), off))
2592 v.Aux = symToAux(sym)
2593 v.AddArg2(ptr, mem)
2594 return true
2595 }
2596 return false
2597 }
2598 func rewriteValue386_Op386DIVSD(v *Value) bool {
2599 v_1 := v.Args[1]
2600 v_0 := v.Args[0]
2601
2602
2603
2604 for {
2605 x := v_0
2606 l := v_1
2607 if l.Op != Op386MOVSDload {
2608 break
2609 }
2610 off := auxIntToInt32(l.AuxInt)
2611 sym := auxToSym(l.Aux)
2612 mem := l.Args[1]
2613 ptr := l.Args[0]
2614 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2615 break
2616 }
2617 v.reset(Op386DIVSDload)
2618 v.AuxInt = int32ToAuxInt(off)
2619 v.Aux = symToAux(sym)
2620 v.AddArg3(x, ptr, mem)
2621 return true
2622 }
2623 return false
2624 }
2625 func rewriteValue386_Op386DIVSDload(v *Value) bool {
2626 v_2 := v.Args[2]
2627 v_1 := v.Args[1]
2628 v_0 := v.Args[0]
2629 b := v.Block
2630 config := b.Func.Config
2631
2632
2633
2634 for {
2635 off1 := auxIntToInt32(v.AuxInt)
2636 sym := auxToSym(v.Aux)
2637 val := v_0
2638 if v_1.Op != Op386ADDLconst {
2639 break
2640 }
2641 off2 := auxIntToInt32(v_1.AuxInt)
2642 base := v_1.Args[0]
2643 mem := v_2
2644 if !(is32Bit(int64(off1) + int64(off2))) {
2645 break
2646 }
2647 v.reset(Op386DIVSDload)
2648 v.AuxInt = int32ToAuxInt(off1 + off2)
2649 v.Aux = symToAux(sym)
2650 v.AddArg3(val, base, mem)
2651 return true
2652 }
2653
2654
2655
2656 for {
2657 off1 := auxIntToInt32(v.AuxInt)
2658 sym1 := auxToSym(v.Aux)
2659 val := v_0
2660 if v_1.Op != Op386LEAL {
2661 break
2662 }
2663 off2 := auxIntToInt32(v_1.AuxInt)
2664 sym2 := auxToSym(v_1.Aux)
2665 base := v_1.Args[0]
2666 mem := v_2
2667 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2668 break
2669 }
2670 v.reset(Op386DIVSDload)
2671 v.AuxInt = int32ToAuxInt(off1 + off2)
2672 v.Aux = symToAux(mergeSym(sym1, sym2))
2673 v.AddArg3(val, base, mem)
2674 return true
2675 }
2676 return false
2677 }
2678 func rewriteValue386_Op386DIVSS(v *Value) bool {
2679 v_1 := v.Args[1]
2680 v_0 := v.Args[0]
2681
2682
2683
2684 for {
2685 x := v_0
2686 l := v_1
2687 if l.Op != Op386MOVSSload {
2688 break
2689 }
2690 off := auxIntToInt32(l.AuxInt)
2691 sym := auxToSym(l.Aux)
2692 mem := l.Args[1]
2693 ptr := l.Args[0]
2694 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2695 break
2696 }
2697 v.reset(Op386DIVSSload)
2698 v.AuxInt = int32ToAuxInt(off)
2699 v.Aux = symToAux(sym)
2700 v.AddArg3(x, ptr, mem)
2701 return true
2702 }
2703 return false
2704 }
2705 func rewriteValue386_Op386DIVSSload(v *Value) bool {
2706 v_2 := v.Args[2]
2707 v_1 := v.Args[1]
2708 v_0 := v.Args[0]
2709 b := v.Block
2710 config := b.Func.Config
2711
2712
2713
2714 for {
2715 off1 := auxIntToInt32(v.AuxInt)
2716 sym := auxToSym(v.Aux)
2717 val := v_0
2718 if v_1.Op != Op386ADDLconst {
2719 break
2720 }
2721 off2 := auxIntToInt32(v_1.AuxInt)
2722 base := v_1.Args[0]
2723 mem := v_2
2724 if !(is32Bit(int64(off1) + int64(off2))) {
2725 break
2726 }
2727 v.reset(Op386DIVSSload)
2728 v.AuxInt = int32ToAuxInt(off1 + off2)
2729 v.Aux = symToAux(sym)
2730 v.AddArg3(val, base, mem)
2731 return true
2732 }
2733
2734
2735
2736 for {
2737 off1 := auxIntToInt32(v.AuxInt)
2738 sym1 := auxToSym(v.Aux)
2739 val := v_0
2740 if v_1.Op != Op386LEAL {
2741 break
2742 }
2743 off2 := auxIntToInt32(v_1.AuxInt)
2744 sym2 := auxToSym(v_1.Aux)
2745 base := v_1.Args[0]
2746 mem := v_2
2747 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2748 break
2749 }
2750 v.reset(Op386DIVSSload)
2751 v.AuxInt = int32ToAuxInt(off1 + off2)
2752 v.Aux = symToAux(mergeSym(sym1, sym2))
2753 v.AddArg3(val, base, mem)
2754 return true
2755 }
2756 return false
2757 }
2758 func rewriteValue386_Op386LEAL(v *Value) bool {
2759 v_0 := v.Args[0]
2760
2761
2762
2763 for {
2764 c := auxIntToInt32(v.AuxInt)
2765 s := auxToSym(v.Aux)
2766 if v_0.Op != Op386ADDLconst {
2767 break
2768 }
2769 d := auxIntToInt32(v_0.AuxInt)
2770 x := v_0.Args[0]
2771 if !(is32Bit(int64(c) + int64(d))) {
2772 break
2773 }
2774 v.reset(Op386LEAL)
2775 v.AuxInt = int32ToAuxInt(c + d)
2776 v.Aux = symToAux(s)
2777 v.AddArg(x)
2778 return true
2779 }
2780
2781
2782
2783 for {
2784 c := auxIntToInt32(v.AuxInt)
2785 s := auxToSym(v.Aux)
2786 if v_0.Op != Op386ADDL {
2787 break
2788 }
2789 _ = v_0.Args[1]
2790 v_0_0 := v_0.Args[0]
2791 v_0_1 := v_0.Args[1]
2792 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
2793 x := v_0_0
2794 y := v_0_1
2795 if !(x.Op != OpSB && y.Op != OpSB) {
2796 continue
2797 }
2798 v.reset(Op386LEAL1)
2799 v.AuxInt = int32ToAuxInt(c)
2800 v.Aux = symToAux(s)
2801 v.AddArg2(x, y)
2802 return true
2803 }
2804 break
2805 }
2806
2807
2808
2809 for {
2810 off1 := auxIntToInt32(v.AuxInt)
2811 sym1 := auxToSym(v.Aux)
2812 if v_0.Op != Op386LEAL {
2813 break
2814 }
2815 off2 := auxIntToInt32(v_0.AuxInt)
2816 sym2 := auxToSym(v_0.Aux)
2817 x := v_0.Args[0]
2818 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2819 break
2820 }
2821 v.reset(Op386LEAL)
2822 v.AuxInt = int32ToAuxInt(off1 + off2)
2823 v.Aux = symToAux(mergeSym(sym1, sym2))
2824 v.AddArg(x)
2825 return true
2826 }
2827
2828
2829
2830 for {
2831 off1 := auxIntToInt32(v.AuxInt)
2832 sym1 := auxToSym(v.Aux)
2833 if v_0.Op != Op386LEAL1 {
2834 break
2835 }
2836 off2 := auxIntToInt32(v_0.AuxInt)
2837 sym2 := auxToSym(v_0.Aux)
2838 y := v_0.Args[1]
2839 x := v_0.Args[0]
2840 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2841 break
2842 }
2843 v.reset(Op386LEAL1)
2844 v.AuxInt = int32ToAuxInt(off1 + off2)
2845 v.Aux = symToAux(mergeSym(sym1, sym2))
2846 v.AddArg2(x, y)
2847 return true
2848 }
2849
2850
2851
2852 for {
2853 off1 := auxIntToInt32(v.AuxInt)
2854 sym1 := auxToSym(v.Aux)
2855 if v_0.Op != Op386LEAL2 {
2856 break
2857 }
2858 off2 := auxIntToInt32(v_0.AuxInt)
2859 sym2 := auxToSym(v_0.Aux)
2860 y := v_0.Args[1]
2861 x := v_0.Args[0]
2862 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2863 break
2864 }
2865 v.reset(Op386LEAL2)
2866 v.AuxInt = int32ToAuxInt(off1 + off2)
2867 v.Aux = symToAux(mergeSym(sym1, sym2))
2868 v.AddArg2(x, y)
2869 return true
2870 }
2871
2872
2873
2874 for {
2875 off1 := auxIntToInt32(v.AuxInt)
2876 sym1 := auxToSym(v.Aux)
2877 if v_0.Op != Op386LEAL4 {
2878 break
2879 }
2880 off2 := auxIntToInt32(v_0.AuxInt)
2881 sym2 := auxToSym(v_0.Aux)
2882 y := v_0.Args[1]
2883 x := v_0.Args[0]
2884 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2885 break
2886 }
2887 v.reset(Op386LEAL4)
2888 v.AuxInt = int32ToAuxInt(off1 + off2)
2889 v.Aux = symToAux(mergeSym(sym1, sym2))
2890 v.AddArg2(x, y)
2891 return true
2892 }
2893
2894
2895
2896 for {
2897 off1 := auxIntToInt32(v.AuxInt)
2898 sym1 := auxToSym(v.Aux)
2899 if v_0.Op != Op386LEAL8 {
2900 break
2901 }
2902 off2 := auxIntToInt32(v_0.AuxInt)
2903 sym2 := auxToSym(v_0.Aux)
2904 y := v_0.Args[1]
2905 x := v_0.Args[0]
2906 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2907 break
2908 }
2909 v.reset(Op386LEAL8)
2910 v.AuxInt = int32ToAuxInt(off1 + off2)
2911 v.Aux = symToAux(mergeSym(sym1, sym2))
2912 v.AddArg2(x, y)
2913 return true
2914 }
2915 return false
2916 }
2917 func rewriteValue386_Op386LEAL1(v *Value) bool {
2918 v_1 := v.Args[1]
2919 v_0 := v.Args[0]
2920
2921
2922
2923 for {
2924 c := auxIntToInt32(v.AuxInt)
2925 s := auxToSym(v.Aux)
2926 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2927 if v_0.Op != Op386ADDLconst {
2928 continue
2929 }
2930 d := auxIntToInt32(v_0.AuxInt)
2931 x := v_0.Args[0]
2932 y := v_1
2933 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
2934 continue
2935 }
2936 v.reset(Op386LEAL1)
2937 v.AuxInt = int32ToAuxInt(c + d)
2938 v.Aux = symToAux(s)
2939 v.AddArg2(x, y)
2940 return true
2941 }
2942 break
2943 }
2944
2945
2946 for {
2947 c := auxIntToInt32(v.AuxInt)
2948 s := auxToSym(v.Aux)
2949 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2950 x := v_0
2951 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
2952 continue
2953 }
2954 y := v_1.Args[0]
2955 v.reset(Op386LEAL2)
2956 v.AuxInt = int32ToAuxInt(c)
2957 v.Aux = symToAux(s)
2958 v.AddArg2(x, y)
2959 return true
2960 }
2961 break
2962 }
2963
2964
2965 for {
2966 c := auxIntToInt32(v.AuxInt)
2967 s := auxToSym(v.Aux)
2968 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2969 x := v_0
2970 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
2971 continue
2972 }
2973 y := v_1.Args[0]
2974 v.reset(Op386LEAL4)
2975 v.AuxInt = int32ToAuxInt(c)
2976 v.Aux = symToAux(s)
2977 v.AddArg2(x, y)
2978 return true
2979 }
2980 break
2981 }
2982
2983
2984 for {
2985 c := auxIntToInt32(v.AuxInt)
2986 s := auxToSym(v.Aux)
2987 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2988 x := v_0
2989 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
2990 continue
2991 }
2992 y := v_1.Args[0]
2993 v.reset(Op386LEAL8)
2994 v.AuxInt = int32ToAuxInt(c)
2995 v.Aux = symToAux(s)
2996 v.AddArg2(x, y)
2997 return true
2998 }
2999 break
3000 }
3001
3002
3003
3004 for {
3005 off1 := auxIntToInt32(v.AuxInt)
3006 sym1 := auxToSym(v.Aux)
3007 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3008 if v_0.Op != Op386LEAL {
3009 continue
3010 }
3011 off2 := auxIntToInt32(v_0.AuxInt)
3012 sym2 := auxToSym(v_0.Aux)
3013 x := v_0.Args[0]
3014 y := v_1
3015 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3016 continue
3017 }
3018 v.reset(Op386LEAL1)
3019 v.AuxInt = int32ToAuxInt(off1 + off2)
3020 v.Aux = symToAux(mergeSym(sym1, sym2))
3021 v.AddArg2(x, y)
3022 return true
3023 }
3024 break
3025 }
3026
3027
3028
3029 for {
3030 off1 := auxIntToInt32(v.AuxInt)
3031 sym1 := auxToSym(v.Aux)
3032 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3033 x := v_0
3034 if v_1.Op != Op386LEAL1 {
3035 continue
3036 }
3037 off2 := auxIntToInt32(v_1.AuxInt)
3038 sym2 := auxToSym(v_1.Aux)
3039 y := v_1.Args[1]
3040 if y != v_1.Args[0] || !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3041 continue
3042 }
3043 v.reset(Op386LEAL2)
3044 v.AuxInt = int32ToAuxInt(off1 + off2)
3045 v.Aux = symToAux(mergeSym(sym1, sym2))
3046 v.AddArg2(x, y)
3047 return true
3048 }
3049 break
3050 }
3051
3052
3053
3054 for {
3055 off1 := auxIntToInt32(v.AuxInt)
3056 sym1 := auxToSym(v.Aux)
3057 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3058 x := v_0
3059 if v_1.Op != Op386LEAL1 {
3060 continue
3061 }
3062 off2 := auxIntToInt32(v_1.AuxInt)
3063 sym2 := auxToSym(v_1.Aux)
3064 _ = v_1.Args[1]
3065 v_1_0 := v_1.Args[0]
3066 v_1_1 := v_1.Args[1]
3067 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3068 if x != v_1_0 {
3069 continue
3070 }
3071 y := v_1_1
3072 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3073 continue
3074 }
3075 v.reset(Op386LEAL2)
3076 v.AuxInt = int32ToAuxInt(off1 + off2)
3077 v.Aux = symToAux(mergeSym(sym1, sym2))
3078 v.AddArg2(y, x)
3079 return true
3080 }
3081 }
3082 break
3083 }
3084
3085
3086 for {
3087 if auxIntToInt32(v.AuxInt) != 0 || auxToSym(v.Aux) != nil {
3088 break
3089 }
3090 x := v_0
3091 y := v_1
3092 v.reset(Op386ADDL)
3093 v.AddArg2(x, y)
3094 return true
3095 }
3096 return false
3097 }
3098 func rewriteValue386_Op386LEAL2(v *Value) bool {
3099 v_1 := v.Args[1]
3100 v_0 := v.Args[0]
3101
3102
3103
3104 for {
3105 c := auxIntToInt32(v.AuxInt)
3106 s := auxToSym(v.Aux)
3107 if v_0.Op != Op386ADDLconst {
3108 break
3109 }
3110 d := auxIntToInt32(v_0.AuxInt)
3111 x := v_0.Args[0]
3112 y := v_1
3113 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3114 break
3115 }
3116 v.reset(Op386LEAL2)
3117 v.AuxInt = int32ToAuxInt(c + d)
3118 v.Aux = symToAux(s)
3119 v.AddArg2(x, y)
3120 return true
3121 }
3122
3123
3124
3125 for {
3126 c := auxIntToInt32(v.AuxInt)
3127 s := auxToSym(v.Aux)
3128 x := v_0
3129 if v_1.Op != Op386ADDLconst {
3130 break
3131 }
3132 d := auxIntToInt32(v_1.AuxInt)
3133 y := v_1.Args[0]
3134 if !(is32Bit(int64(c)+2*int64(d)) && y.Op != OpSB) {
3135 break
3136 }
3137 v.reset(Op386LEAL2)
3138 v.AuxInt = int32ToAuxInt(c + 2*d)
3139 v.Aux = symToAux(s)
3140 v.AddArg2(x, y)
3141 return true
3142 }
3143
3144
3145 for {
3146 c := auxIntToInt32(v.AuxInt)
3147 s := auxToSym(v.Aux)
3148 x := v_0
3149 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3150 break
3151 }
3152 y := v_1.Args[0]
3153 v.reset(Op386LEAL4)
3154 v.AuxInt = int32ToAuxInt(c)
3155 v.Aux = symToAux(s)
3156 v.AddArg2(x, y)
3157 return true
3158 }
3159
3160
3161 for {
3162 c := auxIntToInt32(v.AuxInt)
3163 s := auxToSym(v.Aux)
3164 x := v_0
3165 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
3166 break
3167 }
3168 y := v_1.Args[0]
3169 v.reset(Op386LEAL8)
3170 v.AuxInt = int32ToAuxInt(c)
3171 v.Aux = symToAux(s)
3172 v.AddArg2(x, y)
3173 return true
3174 }
3175
3176
3177
3178 for {
3179 off1 := auxIntToInt32(v.AuxInt)
3180 sym1 := auxToSym(v.Aux)
3181 if v_0.Op != Op386LEAL {
3182 break
3183 }
3184 off2 := auxIntToInt32(v_0.AuxInt)
3185 sym2 := auxToSym(v_0.Aux)
3186 x := v_0.Args[0]
3187 y := v_1
3188 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3189 break
3190 }
3191 v.reset(Op386LEAL2)
3192 v.AuxInt = int32ToAuxInt(off1 + off2)
3193 v.Aux = symToAux(mergeSym(sym1, sym2))
3194 v.AddArg2(x, y)
3195 return true
3196 }
3197
3198
3199
3200 for {
3201 off1 := auxIntToInt32(v.AuxInt)
3202 sym := auxToSym(v.Aux)
3203 x := v_0
3204 if v_1.Op != Op386LEAL1 {
3205 break
3206 }
3207 off2 := auxIntToInt32(v_1.AuxInt)
3208 if auxToSym(v_1.Aux) != nil {
3209 break
3210 }
3211 y := v_1.Args[1]
3212 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 2*int64(off2))) {
3213 break
3214 }
3215 v.reset(Op386LEAL4)
3216 v.AuxInt = int32ToAuxInt(off1 + 2*off2)
3217 v.Aux = symToAux(sym)
3218 v.AddArg2(x, y)
3219 return true
3220 }
3221 return false
3222 }
3223 func rewriteValue386_Op386LEAL4(v *Value) bool {
3224 v_1 := v.Args[1]
3225 v_0 := v.Args[0]
3226
3227
3228
3229 for {
3230 c := auxIntToInt32(v.AuxInt)
3231 s := auxToSym(v.Aux)
3232 if v_0.Op != Op386ADDLconst {
3233 break
3234 }
3235 d := auxIntToInt32(v_0.AuxInt)
3236 x := v_0.Args[0]
3237 y := v_1
3238 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3239 break
3240 }
3241 v.reset(Op386LEAL4)
3242 v.AuxInt = int32ToAuxInt(c + d)
3243 v.Aux = symToAux(s)
3244 v.AddArg2(x, y)
3245 return true
3246 }
3247
3248
3249
3250 for {
3251 c := auxIntToInt32(v.AuxInt)
3252 s := auxToSym(v.Aux)
3253 x := v_0
3254 if v_1.Op != Op386ADDLconst {
3255 break
3256 }
3257 d := auxIntToInt32(v_1.AuxInt)
3258 y := v_1.Args[0]
3259 if !(is32Bit(int64(c)+4*int64(d)) && y.Op != OpSB) {
3260 break
3261 }
3262 v.reset(Op386LEAL4)
3263 v.AuxInt = int32ToAuxInt(c + 4*d)
3264 v.Aux = symToAux(s)
3265 v.AddArg2(x, y)
3266 return true
3267 }
3268
3269
3270 for {
3271 c := auxIntToInt32(v.AuxInt)
3272 s := auxToSym(v.Aux)
3273 x := v_0
3274 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3275 break
3276 }
3277 y := v_1.Args[0]
3278 v.reset(Op386LEAL8)
3279 v.AuxInt = int32ToAuxInt(c)
3280 v.Aux = symToAux(s)
3281 v.AddArg2(x, y)
3282 return true
3283 }
3284
3285
3286
3287 for {
3288 off1 := auxIntToInt32(v.AuxInt)
3289 sym1 := auxToSym(v.Aux)
3290 if v_0.Op != Op386LEAL {
3291 break
3292 }
3293 off2 := auxIntToInt32(v_0.AuxInt)
3294 sym2 := auxToSym(v_0.Aux)
3295 x := v_0.Args[0]
3296 y := v_1
3297 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3298 break
3299 }
3300 v.reset(Op386LEAL4)
3301 v.AuxInt = int32ToAuxInt(off1 + off2)
3302 v.Aux = symToAux(mergeSym(sym1, sym2))
3303 v.AddArg2(x, y)
3304 return true
3305 }
3306
3307
3308
3309 for {
3310 off1 := auxIntToInt32(v.AuxInt)
3311 sym := auxToSym(v.Aux)
3312 x := v_0
3313 if v_1.Op != Op386LEAL1 {
3314 break
3315 }
3316 off2 := auxIntToInt32(v_1.AuxInt)
3317 if auxToSym(v_1.Aux) != nil {
3318 break
3319 }
3320 y := v_1.Args[1]
3321 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 4*int64(off2))) {
3322 break
3323 }
3324 v.reset(Op386LEAL8)
3325 v.AuxInt = int32ToAuxInt(off1 + 4*off2)
3326 v.Aux = symToAux(sym)
3327 v.AddArg2(x, y)
3328 return true
3329 }
3330 return false
3331 }
3332 func rewriteValue386_Op386LEAL8(v *Value) bool {
3333 v_1 := v.Args[1]
3334 v_0 := v.Args[0]
3335
3336
3337
3338 for {
3339 c := auxIntToInt32(v.AuxInt)
3340 s := auxToSym(v.Aux)
3341 if v_0.Op != Op386ADDLconst {
3342 break
3343 }
3344 d := auxIntToInt32(v_0.AuxInt)
3345 x := v_0.Args[0]
3346 y := v_1
3347 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3348 break
3349 }
3350 v.reset(Op386LEAL8)
3351 v.AuxInt = int32ToAuxInt(c + d)
3352 v.Aux = symToAux(s)
3353 v.AddArg2(x, y)
3354 return true
3355 }
3356
3357
3358
3359 for {
3360 c := auxIntToInt32(v.AuxInt)
3361 s := auxToSym(v.Aux)
3362 x := v_0
3363 if v_1.Op != Op386ADDLconst {
3364 break
3365 }
3366 d := auxIntToInt32(v_1.AuxInt)
3367 y := v_1.Args[0]
3368 if !(is32Bit(int64(c)+8*int64(d)) && y.Op != OpSB) {
3369 break
3370 }
3371 v.reset(Op386LEAL8)
3372 v.AuxInt = int32ToAuxInt(c + 8*d)
3373 v.Aux = symToAux(s)
3374 v.AddArg2(x, y)
3375 return true
3376 }
3377
3378
3379
3380 for {
3381 off1 := auxIntToInt32(v.AuxInt)
3382 sym1 := auxToSym(v.Aux)
3383 if v_0.Op != Op386LEAL {
3384 break
3385 }
3386 off2 := auxIntToInt32(v_0.AuxInt)
3387 sym2 := auxToSym(v_0.Aux)
3388 x := v_0.Args[0]
3389 y := v_1
3390 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3391 break
3392 }
3393 v.reset(Op386LEAL8)
3394 v.AuxInt = int32ToAuxInt(off1 + off2)
3395 v.Aux = symToAux(mergeSym(sym1, sym2))
3396 v.AddArg2(x, y)
3397 return true
3398 }
3399 return false
3400 }
3401 func rewriteValue386_Op386MOVBLSX(v *Value) bool {
3402 v_0 := v.Args[0]
3403 b := v.Block
3404
3405
3406
3407 for {
3408 x := v_0
3409 if x.Op != Op386MOVBload {
3410 break
3411 }
3412 off := auxIntToInt32(x.AuxInt)
3413 sym := auxToSym(x.Aux)
3414 mem := x.Args[1]
3415 ptr := x.Args[0]
3416 if !(x.Uses == 1 && clobber(x)) {
3417 break
3418 }
3419 b = x.Block
3420 v0 := b.NewValue0(x.Pos, Op386MOVBLSXload, v.Type)
3421 v.copyOf(v0)
3422 v0.AuxInt = int32ToAuxInt(off)
3423 v0.Aux = symToAux(sym)
3424 v0.AddArg2(ptr, mem)
3425 return true
3426 }
3427
3428
3429
3430 for {
3431 if v_0.Op != Op386ANDLconst {
3432 break
3433 }
3434 c := auxIntToInt32(v_0.AuxInt)
3435 x := v_0.Args[0]
3436 if !(c&0x80 == 0) {
3437 break
3438 }
3439 v.reset(Op386ANDLconst)
3440 v.AuxInt = int32ToAuxInt(c & 0x7f)
3441 v.AddArg(x)
3442 return true
3443 }
3444 return false
3445 }
3446 func rewriteValue386_Op386MOVBLSXload(v *Value) bool {
3447 v_1 := v.Args[1]
3448 v_0 := v.Args[0]
3449 b := v.Block
3450 config := b.Func.Config
3451
3452
3453
3454 for {
3455 off := auxIntToInt32(v.AuxInt)
3456 sym := auxToSym(v.Aux)
3457 ptr := v_0
3458 if v_1.Op != Op386MOVBstore {
3459 break
3460 }
3461 off2 := auxIntToInt32(v_1.AuxInt)
3462 sym2 := auxToSym(v_1.Aux)
3463 x := v_1.Args[1]
3464 ptr2 := v_1.Args[0]
3465 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3466 break
3467 }
3468 v.reset(Op386MOVBLSX)
3469 v.AddArg(x)
3470 return true
3471 }
3472
3473
3474
3475 for {
3476 off1 := auxIntToInt32(v.AuxInt)
3477 sym1 := auxToSym(v.Aux)
3478 if v_0.Op != Op386LEAL {
3479 break
3480 }
3481 off2 := auxIntToInt32(v_0.AuxInt)
3482 sym2 := auxToSym(v_0.Aux)
3483 base := v_0.Args[0]
3484 mem := v_1
3485 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3486 break
3487 }
3488 v.reset(Op386MOVBLSXload)
3489 v.AuxInt = int32ToAuxInt(off1 + off2)
3490 v.Aux = symToAux(mergeSym(sym1, sym2))
3491 v.AddArg2(base, mem)
3492 return true
3493 }
3494
3495
3496
3497 for {
3498 off := auxIntToInt32(v.AuxInt)
3499 sym := auxToSym(v.Aux)
3500 if v_0.Op != OpSB || !(symIsRO(sym)) {
3501 break
3502 }
3503 v.reset(Op386MOVLconst)
3504 v.AuxInt = int32ToAuxInt(int32(int8(read8(sym, int64(off)))))
3505 return true
3506 }
3507 return false
3508 }
3509 func rewriteValue386_Op386MOVBLZX(v *Value) bool {
3510 v_0 := v.Args[0]
3511 b := v.Block
3512
3513
3514
3515 for {
3516 x := v_0
3517 if x.Op != Op386MOVBload {
3518 break
3519 }
3520 off := auxIntToInt32(x.AuxInt)
3521 sym := auxToSym(x.Aux)
3522 mem := x.Args[1]
3523 ptr := x.Args[0]
3524 if !(x.Uses == 1 && clobber(x)) {
3525 break
3526 }
3527 b = x.Block
3528 v0 := b.NewValue0(x.Pos, Op386MOVBload, v.Type)
3529 v.copyOf(v0)
3530 v0.AuxInt = int32ToAuxInt(off)
3531 v0.Aux = symToAux(sym)
3532 v0.AddArg2(ptr, mem)
3533 return true
3534 }
3535
3536
3537 for {
3538 if v_0.Op != Op386ANDLconst {
3539 break
3540 }
3541 c := auxIntToInt32(v_0.AuxInt)
3542 x := v_0.Args[0]
3543 v.reset(Op386ANDLconst)
3544 v.AuxInt = int32ToAuxInt(c & 0xff)
3545 v.AddArg(x)
3546 return true
3547 }
3548 return false
3549 }
3550 func rewriteValue386_Op386MOVBload(v *Value) bool {
3551 v_1 := v.Args[1]
3552 v_0 := v.Args[0]
3553 b := v.Block
3554 config := b.Func.Config
3555
3556
3557
3558 for {
3559 off := auxIntToInt32(v.AuxInt)
3560 sym := auxToSym(v.Aux)
3561 ptr := v_0
3562 if v_1.Op != Op386MOVBstore {
3563 break
3564 }
3565 off2 := auxIntToInt32(v_1.AuxInt)
3566 sym2 := auxToSym(v_1.Aux)
3567 x := v_1.Args[1]
3568 ptr2 := v_1.Args[0]
3569 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3570 break
3571 }
3572 v.reset(Op386MOVBLZX)
3573 v.AddArg(x)
3574 return true
3575 }
3576
3577
3578
3579 for {
3580 off1 := auxIntToInt32(v.AuxInt)
3581 sym := auxToSym(v.Aux)
3582 if v_0.Op != Op386ADDLconst {
3583 break
3584 }
3585 off2 := auxIntToInt32(v_0.AuxInt)
3586 ptr := v_0.Args[0]
3587 mem := v_1
3588 if !(is32Bit(int64(off1) + int64(off2))) {
3589 break
3590 }
3591 v.reset(Op386MOVBload)
3592 v.AuxInt = int32ToAuxInt(off1 + off2)
3593 v.Aux = symToAux(sym)
3594 v.AddArg2(ptr, mem)
3595 return true
3596 }
3597
3598
3599
3600 for {
3601 off1 := auxIntToInt32(v.AuxInt)
3602 sym1 := auxToSym(v.Aux)
3603 if v_0.Op != Op386LEAL {
3604 break
3605 }
3606 off2 := auxIntToInt32(v_0.AuxInt)
3607 sym2 := auxToSym(v_0.Aux)
3608 base := v_0.Args[0]
3609 mem := v_1
3610 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3611 break
3612 }
3613 v.reset(Op386MOVBload)
3614 v.AuxInt = int32ToAuxInt(off1 + off2)
3615 v.Aux = symToAux(mergeSym(sym1, sym2))
3616 v.AddArg2(base, mem)
3617 return true
3618 }
3619
3620
3621
3622 for {
3623 off := auxIntToInt32(v.AuxInt)
3624 sym := auxToSym(v.Aux)
3625 if v_0.Op != OpSB || !(symIsRO(sym)) {
3626 break
3627 }
3628 v.reset(Op386MOVLconst)
3629 v.AuxInt = int32ToAuxInt(int32(read8(sym, int64(off))))
3630 return true
3631 }
3632 return false
3633 }
3634 func rewriteValue386_Op386MOVBstore(v *Value) bool {
3635 v_2 := v.Args[2]
3636 v_1 := v.Args[1]
3637 v_0 := v.Args[0]
3638 b := v.Block
3639 config := b.Func.Config
3640
3641
3642 for {
3643 off := auxIntToInt32(v.AuxInt)
3644 sym := auxToSym(v.Aux)
3645 ptr := v_0
3646 if v_1.Op != Op386MOVBLSX {
3647 break
3648 }
3649 x := v_1.Args[0]
3650 mem := v_2
3651 v.reset(Op386MOVBstore)
3652 v.AuxInt = int32ToAuxInt(off)
3653 v.Aux = symToAux(sym)
3654 v.AddArg3(ptr, x, mem)
3655 return true
3656 }
3657
3658
3659 for {
3660 off := auxIntToInt32(v.AuxInt)
3661 sym := auxToSym(v.Aux)
3662 ptr := v_0
3663 if v_1.Op != Op386MOVBLZX {
3664 break
3665 }
3666 x := v_1.Args[0]
3667 mem := v_2
3668 v.reset(Op386MOVBstore)
3669 v.AuxInt = int32ToAuxInt(off)
3670 v.Aux = symToAux(sym)
3671 v.AddArg3(ptr, x, mem)
3672 return true
3673 }
3674
3675
3676
3677 for {
3678 off1 := auxIntToInt32(v.AuxInt)
3679 sym := auxToSym(v.Aux)
3680 if v_0.Op != Op386ADDLconst {
3681 break
3682 }
3683 off2 := auxIntToInt32(v_0.AuxInt)
3684 ptr := v_0.Args[0]
3685 val := v_1
3686 mem := v_2
3687 if !(is32Bit(int64(off1) + int64(off2))) {
3688 break
3689 }
3690 v.reset(Op386MOVBstore)
3691 v.AuxInt = int32ToAuxInt(off1 + off2)
3692 v.Aux = symToAux(sym)
3693 v.AddArg3(ptr, val, mem)
3694 return true
3695 }
3696
3697
3698 for {
3699 off := auxIntToInt32(v.AuxInt)
3700 sym := auxToSym(v.Aux)
3701 ptr := v_0
3702 if v_1.Op != Op386MOVLconst {
3703 break
3704 }
3705 c := auxIntToInt32(v_1.AuxInt)
3706 mem := v_2
3707 v.reset(Op386MOVBstoreconst)
3708 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
3709 v.Aux = symToAux(sym)
3710 v.AddArg2(ptr, mem)
3711 return true
3712 }
3713
3714
3715
3716 for {
3717 off1 := auxIntToInt32(v.AuxInt)
3718 sym1 := auxToSym(v.Aux)
3719 if v_0.Op != Op386LEAL {
3720 break
3721 }
3722 off2 := auxIntToInt32(v_0.AuxInt)
3723 sym2 := auxToSym(v_0.Aux)
3724 base := v_0.Args[0]
3725 val := v_1
3726 mem := v_2
3727 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3728 break
3729 }
3730 v.reset(Op386MOVBstore)
3731 v.AuxInt = int32ToAuxInt(off1 + off2)
3732 v.Aux = symToAux(mergeSym(sym1, sym2))
3733 v.AddArg3(base, val, mem)
3734 return true
3735 }
3736 return false
3737 }
3738 func rewriteValue386_Op386MOVBstoreconst(v *Value) bool {
3739 v_1 := v.Args[1]
3740 v_0 := v.Args[0]
3741 b := v.Block
3742 config := b.Func.Config
3743
3744
3745
3746 for {
3747 sc := auxIntToValAndOff(v.AuxInt)
3748 s := auxToSym(v.Aux)
3749 if v_0.Op != Op386ADDLconst {
3750 break
3751 }
3752 off := auxIntToInt32(v_0.AuxInt)
3753 ptr := v_0.Args[0]
3754 mem := v_1
3755 if !(sc.canAdd32(off)) {
3756 break
3757 }
3758 v.reset(Op386MOVBstoreconst)
3759 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
3760 v.Aux = symToAux(s)
3761 v.AddArg2(ptr, mem)
3762 return true
3763 }
3764
3765
3766
3767 for {
3768 sc := auxIntToValAndOff(v.AuxInt)
3769 sym1 := auxToSym(v.Aux)
3770 if v_0.Op != Op386LEAL {
3771 break
3772 }
3773 off := auxIntToInt32(v_0.AuxInt)
3774 sym2 := auxToSym(v_0.Aux)
3775 ptr := v_0.Args[0]
3776 mem := v_1
3777 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3778 break
3779 }
3780 v.reset(Op386MOVBstoreconst)
3781 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
3782 v.Aux = symToAux(mergeSym(sym1, sym2))
3783 v.AddArg2(ptr, mem)
3784 return true
3785 }
3786 return false
3787 }
3788 func rewriteValue386_Op386MOVLload(v *Value) bool {
3789 v_1 := v.Args[1]
3790 v_0 := v.Args[0]
3791 b := v.Block
3792 config := b.Func.Config
3793
3794
3795
3796 for {
3797 off := auxIntToInt32(v.AuxInt)
3798 sym := auxToSym(v.Aux)
3799 ptr := v_0
3800 if v_1.Op != Op386MOVLstore {
3801 break
3802 }
3803 off2 := auxIntToInt32(v_1.AuxInt)
3804 sym2 := auxToSym(v_1.Aux)
3805 x := v_1.Args[1]
3806 ptr2 := v_1.Args[0]
3807 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3808 break
3809 }
3810 v.copyOf(x)
3811 return true
3812 }
3813
3814
3815
3816 for {
3817 off1 := auxIntToInt32(v.AuxInt)
3818 sym := auxToSym(v.Aux)
3819 if v_0.Op != Op386ADDLconst {
3820 break
3821 }
3822 off2 := auxIntToInt32(v_0.AuxInt)
3823 ptr := v_0.Args[0]
3824 mem := v_1
3825 if !(is32Bit(int64(off1) + int64(off2))) {
3826 break
3827 }
3828 v.reset(Op386MOVLload)
3829 v.AuxInt = int32ToAuxInt(off1 + off2)
3830 v.Aux = symToAux(sym)
3831 v.AddArg2(ptr, mem)
3832 return true
3833 }
3834
3835
3836
3837 for {
3838 off1 := auxIntToInt32(v.AuxInt)
3839 sym1 := auxToSym(v.Aux)
3840 if v_0.Op != Op386LEAL {
3841 break
3842 }
3843 off2 := auxIntToInt32(v_0.AuxInt)
3844 sym2 := auxToSym(v_0.Aux)
3845 base := v_0.Args[0]
3846 mem := v_1
3847 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3848 break
3849 }
3850 v.reset(Op386MOVLload)
3851 v.AuxInt = int32ToAuxInt(off1 + off2)
3852 v.Aux = symToAux(mergeSym(sym1, sym2))
3853 v.AddArg2(base, mem)
3854 return true
3855 }
3856
3857
3858
3859 for {
3860 off := auxIntToInt32(v.AuxInt)
3861 sym := auxToSym(v.Aux)
3862 if v_0.Op != OpSB || !(symIsRO(sym)) {
3863 break
3864 }
3865 v.reset(Op386MOVLconst)
3866 v.AuxInt = int32ToAuxInt(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
3867 return true
3868 }
3869 return false
3870 }
3871 func rewriteValue386_Op386MOVLstore(v *Value) bool {
3872 v_2 := v.Args[2]
3873 v_1 := v.Args[1]
3874 v_0 := v.Args[0]
3875 b := v.Block
3876 config := b.Func.Config
3877
3878
3879
3880 for {
3881 off1 := auxIntToInt32(v.AuxInt)
3882 sym := auxToSym(v.Aux)
3883 if v_0.Op != Op386ADDLconst {
3884 break
3885 }
3886 off2 := auxIntToInt32(v_0.AuxInt)
3887 ptr := v_0.Args[0]
3888 val := v_1
3889 mem := v_2
3890 if !(is32Bit(int64(off1) + int64(off2))) {
3891 break
3892 }
3893 v.reset(Op386MOVLstore)
3894 v.AuxInt = int32ToAuxInt(off1 + off2)
3895 v.Aux = symToAux(sym)
3896 v.AddArg3(ptr, val, mem)
3897 return true
3898 }
3899
3900
3901 for {
3902 off := auxIntToInt32(v.AuxInt)
3903 sym := auxToSym(v.Aux)
3904 ptr := v_0
3905 if v_1.Op != Op386MOVLconst {
3906 break
3907 }
3908 c := auxIntToInt32(v_1.AuxInt)
3909 mem := v_2
3910 v.reset(Op386MOVLstoreconst)
3911 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
3912 v.Aux = symToAux(sym)
3913 v.AddArg2(ptr, mem)
3914 return true
3915 }
3916
3917
3918
3919 for {
3920 off1 := auxIntToInt32(v.AuxInt)
3921 sym1 := auxToSym(v.Aux)
3922 if v_0.Op != Op386LEAL {
3923 break
3924 }
3925 off2 := auxIntToInt32(v_0.AuxInt)
3926 sym2 := auxToSym(v_0.Aux)
3927 base := v_0.Args[0]
3928 val := v_1
3929 mem := v_2
3930 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3931 break
3932 }
3933 v.reset(Op386MOVLstore)
3934 v.AuxInt = int32ToAuxInt(off1 + off2)
3935 v.Aux = symToAux(mergeSym(sym1, sym2))
3936 v.AddArg3(base, val, mem)
3937 return true
3938 }
3939
3940
3941
3942 for {
3943 off := auxIntToInt32(v.AuxInt)
3944 sym := auxToSym(v.Aux)
3945 ptr := v_0
3946 y := v_1
3947 if y.Op != Op386ADDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
3948 break
3949 }
3950 mem := y.Args[2]
3951 x := y.Args[0]
3952 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
3953 break
3954 }
3955 v.reset(Op386ADDLmodify)
3956 v.AuxInt = int32ToAuxInt(off)
3957 v.Aux = symToAux(sym)
3958 v.AddArg3(ptr, x, mem)
3959 return true
3960 }
3961
3962
3963
3964 for {
3965 off := auxIntToInt32(v.AuxInt)
3966 sym := auxToSym(v.Aux)
3967 ptr := v_0
3968 y := v_1
3969 if y.Op != Op386ANDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
3970 break
3971 }
3972 mem := y.Args[2]
3973 x := y.Args[0]
3974 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
3975 break
3976 }
3977 v.reset(Op386ANDLmodify)
3978 v.AuxInt = int32ToAuxInt(off)
3979 v.Aux = symToAux(sym)
3980 v.AddArg3(ptr, x, mem)
3981 return true
3982 }
3983
3984
3985
3986 for {
3987 off := auxIntToInt32(v.AuxInt)
3988 sym := auxToSym(v.Aux)
3989 ptr := v_0
3990 y := v_1
3991 if y.Op != Op386ORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
3992 break
3993 }
3994 mem := y.Args[2]
3995 x := y.Args[0]
3996 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
3997 break
3998 }
3999 v.reset(Op386ORLmodify)
4000 v.AuxInt = int32ToAuxInt(off)
4001 v.Aux = symToAux(sym)
4002 v.AddArg3(ptr, x, mem)
4003 return true
4004 }
4005
4006
4007
4008 for {
4009 off := auxIntToInt32(v.AuxInt)
4010 sym := auxToSym(v.Aux)
4011 ptr := v_0
4012 y := v_1
4013 if y.Op != Op386XORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4014 break
4015 }
4016 mem := y.Args[2]
4017 x := y.Args[0]
4018 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4019 break
4020 }
4021 v.reset(Op386XORLmodify)
4022 v.AuxInt = int32ToAuxInt(off)
4023 v.Aux = symToAux(sym)
4024 v.AddArg3(ptr, x, mem)
4025 return true
4026 }
4027
4028
4029
4030 for {
4031 off := auxIntToInt32(v.AuxInt)
4032 sym := auxToSym(v.Aux)
4033 ptr := v_0
4034 y := v_1
4035 if y.Op != Op386ADDL {
4036 break
4037 }
4038 _ = y.Args[1]
4039 y_0 := y.Args[0]
4040 y_1 := y.Args[1]
4041 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4042 l := y_0
4043 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4044 continue
4045 }
4046 mem := l.Args[1]
4047 if ptr != l.Args[0] {
4048 continue
4049 }
4050 x := y_1
4051 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4052 continue
4053 }
4054 v.reset(Op386ADDLmodify)
4055 v.AuxInt = int32ToAuxInt(off)
4056 v.Aux = symToAux(sym)
4057 v.AddArg3(ptr, x, mem)
4058 return true
4059 }
4060 break
4061 }
4062
4063
4064
4065 for {
4066 off := auxIntToInt32(v.AuxInt)
4067 sym := auxToSym(v.Aux)
4068 ptr := v_0
4069 y := v_1
4070 if y.Op != Op386SUBL {
4071 break
4072 }
4073 x := y.Args[1]
4074 l := y.Args[0]
4075 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4076 break
4077 }
4078 mem := l.Args[1]
4079 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4080 break
4081 }
4082 v.reset(Op386SUBLmodify)
4083 v.AuxInt = int32ToAuxInt(off)
4084 v.Aux = symToAux(sym)
4085 v.AddArg3(ptr, x, mem)
4086 return true
4087 }
4088
4089
4090
4091 for {
4092 off := auxIntToInt32(v.AuxInt)
4093 sym := auxToSym(v.Aux)
4094 ptr := v_0
4095 y := v_1
4096 if y.Op != Op386ANDL {
4097 break
4098 }
4099 _ = y.Args[1]
4100 y_0 := y.Args[0]
4101 y_1 := y.Args[1]
4102 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4103 l := y_0
4104 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4105 continue
4106 }
4107 mem := l.Args[1]
4108 if ptr != l.Args[0] {
4109 continue
4110 }
4111 x := y_1
4112 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4113 continue
4114 }
4115 v.reset(Op386ANDLmodify)
4116 v.AuxInt = int32ToAuxInt(off)
4117 v.Aux = symToAux(sym)
4118 v.AddArg3(ptr, x, mem)
4119 return true
4120 }
4121 break
4122 }
4123
4124
4125
4126 for {
4127 off := auxIntToInt32(v.AuxInt)
4128 sym := auxToSym(v.Aux)
4129 ptr := v_0
4130 y := v_1
4131 if y.Op != Op386ORL {
4132 break
4133 }
4134 _ = y.Args[1]
4135 y_0 := y.Args[0]
4136 y_1 := y.Args[1]
4137 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4138 l := y_0
4139 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4140 continue
4141 }
4142 mem := l.Args[1]
4143 if ptr != l.Args[0] {
4144 continue
4145 }
4146 x := y_1
4147 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4148 continue
4149 }
4150 v.reset(Op386ORLmodify)
4151 v.AuxInt = int32ToAuxInt(off)
4152 v.Aux = symToAux(sym)
4153 v.AddArg3(ptr, x, mem)
4154 return true
4155 }
4156 break
4157 }
4158
4159
4160
4161 for {
4162 off := auxIntToInt32(v.AuxInt)
4163 sym := auxToSym(v.Aux)
4164 ptr := v_0
4165 y := v_1
4166 if y.Op != Op386XORL {
4167 break
4168 }
4169 _ = y.Args[1]
4170 y_0 := y.Args[0]
4171 y_1 := y.Args[1]
4172 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4173 l := y_0
4174 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4175 continue
4176 }
4177 mem := l.Args[1]
4178 if ptr != l.Args[0] {
4179 continue
4180 }
4181 x := y_1
4182 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4183 continue
4184 }
4185 v.reset(Op386XORLmodify)
4186 v.AuxInt = int32ToAuxInt(off)
4187 v.Aux = symToAux(sym)
4188 v.AddArg3(ptr, x, mem)
4189 return true
4190 }
4191 break
4192 }
4193
4194
4195
4196 for {
4197 off := auxIntToInt32(v.AuxInt)
4198 sym := auxToSym(v.Aux)
4199 ptr := v_0
4200 y := v_1
4201 if y.Op != Op386ADDLconst {
4202 break
4203 }
4204 c := auxIntToInt32(y.AuxInt)
4205 l := y.Args[0]
4206 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4207 break
4208 }
4209 mem := l.Args[1]
4210 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4211 break
4212 }
4213 v.reset(Op386ADDLconstmodify)
4214 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4215 v.Aux = symToAux(sym)
4216 v.AddArg2(ptr, mem)
4217 return true
4218 }
4219
4220
4221
4222 for {
4223 off := auxIntToInt32(v.AuxInt)
4224 sym := auxToSym(v.Aux)
4225 ptr := v_0
4226 y := v_1
4227 if y.Op != Op386ANDLconst {
4228 break
4229 }
4230 c := auxIntToInt32(y.AuxInt)
4231 l := y.Args[0]
4232 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4233 break
4234 }
4235 mem := l.Args[1]
4236 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4237 break
4238 }
4239 v.reset(Op386ANDLconstmodify)
4240 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4241 v.Aux = symToAux(sym)
4242 v.AddArg2(ptr, mem)
4243 return true
4244 }
4245
4246
4247
4248 for {
4249 off := auxIntToInt32(v.AuxInt)
4250 sym := auxToSym(v.Aux)
4251 ptr := v_0
4252 y := v_1
4253 if y.Op != Op386ORLconst {
4254 break
4255 }
4256 c := auxIntToInt32(y.AuxInt)
4257 l := y.Args[0]
4258 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4259 break
4260 }
4261 mem := l.Args[1]
4262 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4263 break
4264 }
4265 v.reset(Op386ORLconstmodify)
4266 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4267 v.Aux = symToAux(sym)
4268 v.AddArg2(ptr, mem)
4269 return true
4270 }
4271
4272
4273
4274 for {
4275 off := auxIntToInt32(v.AuxInt)
4276 sym := auxToSym(v.Aux)
4277 ptr := v_0
4278 y := v_1
4279 if y.Op != Op386XORLconst {
4280 break
4281 }
4282 c := auxIntToInt32(y.AuxInt)
4283 l := y.Args[0]
4284 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4285 break
4286 }
4287 mem := l.Args[1]
4288 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4289 break
4290 }
4291 v.reset(Op386XORLconstmodify)
4292 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4293 v.Aux = symToAux(sym)
4294 v.AddArg2(ptr, mem)
4295 return true
4296 }
4297 return false
4298 }
4299 func rewriteValue386_Op386MOVLstoreconst(v *Value) bool {
4300 v_1 := v.Args[1]
4301 v_0 := v.Args[0]
4302 b := v.Block
4303 config := b.Func.Config
4304
4305
4306
4307 for {
4308 sc := auxIntToValAndOff(v.AuxInt)
4309 s := auxToSym(v.Aux)
4310 if v_0.Op != Op386ADDLconst {
4311 break
4312 }
4313 off := auxIntToInt32(v_0.AuxInt)
4314 ptr := v_0.Args[0]
4315 mem := v_1
4316 if !(sc.canAdd32(off)) {
4317 break
4318 }
4319 v.reset(Op386MOVLstoreconst)
4320 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4321 v.Aux = symToAux(s)
4322 v.AddArg2(ptr, mem)
4323 return true
4324 }
4325
4326
4327
4328 for {
4329 sc := auxIntToValAndOff(v.AuxInt)
4330 sym1 := auxToSym(v.Aux)
4331 if v_0.Op != Op386LEAL {
4332 break
4333 }
4334 off := auxIntToInt32(v_0.AuxInt)
4335 sym2 := auxToSym(v_0.Aux)
4336 ptr := v_0.Args[0]
4337 mem := v_1
4338 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4339 break
4340 }
4341 v.reset(Op386MOVLstoreconst)
4342 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4343 v.Aux = symToAux(mergeSym(sym1, sym2))
4344 v.AddArg2(ptr, mem)
4345 return true
4346 }
4347 return false
4348 }
4349 func rewriteValue386_Op386MOVSDconst(v *Value) bool {
4350 b := v.Block
4351 config := b.Func.Config
4352 typ := &b.Func.Config.Types
4353
4354
4355
4356 for {
4357 c := auxIntToFloat64(v.AuxInt)
4358 if !(config.ctxt.Flag_shared) {
4359 break
4360 }
4361 v.reset(Op386MOVSDconst2)
4362 v0 := b.NewValue0(v.Pos, Op386MOVSDconst1, typ.UInt32)
4363 v0.AuxInt = float64ToAuxInt(c)
4364 v.AddArg(v0)
4365 return true
4366 }
4367 return false
4368 }
4369 func rewriteValue386_Op386MOVSDload(v *Value) bool {
4370 v_1 := v.Args[1]
4371 v_0 := v.Args[0]
4372 b := v.Block
4373 config := b.Func.Config
4374
4375
4376
4377 for {
4378 off1 := auxIntToInt32(v.AuxInt)
4379 sym := auxToSym(v.Aux)
4380 if v_0.Op != Op386ADDLconst {
4381 break
4382 }
4383 off2 := auxIntToInt32(v_0.AuxInt)
4384 ptr := v_0.Args[0]
4385 mem := v_1
4386 if !(is32Bit(int64(off1) + int64(off2))) {
4387 break
4388 }
4389 v.reset(Op386MOVSDload)
4390 v.AuxInt = int32ToAuxInt(off1 + off2)
4391 v.Aux = symToAux(sym)
4392 v.AddArg2(ptr, mem)
4393 return true
4394 }
4395
4396
4397
4398 for {
4399 off1 := auxIntToInt32(v.AuxInt)
4400 sym1 := auxToSym(v.Aux)
4401 if v_0.Op != Op386LEAL {
4402 break
4403 }
4404 off2 := auxIntToInt32(v_0.AuxInt)
4405 sym2 := auxToSym(v_0.Aux)
4406 base := v_0.Args[0]
4407 mem := v_1
4408 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4409 break
4410 }
4411 v.reset(Op386MOVSDload)
4412 v.AuxInt = int32ToAuxInt(off1 + off2)
4413 v.Aux = symToAux(mergeSym(sym1, sym2))
4414 v.AddArg2(base, mem)
4415 return true
4416 }
4417 return false
4418 }
4419 func rewriteValue386_Op386MOVSDstore(v *Value) bool {
4420 v_2 := v.Args[2]
4421 v_1 := v.Args[1]
4422 v_0 := v.Args[0]
4423 b := v.Block
4424 config := b.Func.Config
4425
4426
4427
4428 for {
4429 off1 := auxIntToInt32(v.AuxInt)
4430 sym := auxToSym(v.Aux)
4431 if v_0.Op != Op386ADDLconst {
4432 break
4433 }
4434 off2 := auxIntToInt32(v_0.AuxInt)
4435 ptr := v_0.Args[0]
4436 val := v_1
4437 mem := v_2
4438 if !(is32Bit(int64(off1) + int64(off2))) {
4439 break
4440 }
4441 v.reset(Op386MOVSDstore)
4442 v.AuxInt = int32ToAuxInt(off1 + off2)
4443 v.Aux = symToAux(sym)
4444 v.AddArg3(ptr, val, mem)
4445 return true
4446 }
4447
4448
4449
4450 for {
4451 off1 := auxIntToInt32(v.AuxInt)
4452 sym1 := auxToSym(v.Aux)
4453 if v_0.Op != Op386LEAL {
4454 break
4455 }
4456 off2 := auxIntToInt32(v_0.AuxInt)
4457 sym2 := auxToSym(v_0.Aux)
4458 base := v_0.Args[0]
4459 val := v_1
4460 mem := v_2
4461 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4462 break
4463 }
4464 v.reset(Op386MOVSDstore)
4465 v.AuxInt = int32ToAuxInt(off1 + off2)
4466 v.Aux = symToAux(mergeSym(sym1, sym2))
4467 v.AddArg3(base, val, mem)
4468 return true
4469 }
4470 return false
4471 }
4472 func rewriteValue386_Op386MOVSSconst(v *Value) bool {
4473 b := v.Block
4474 config := b.Func.Config
4475 typ := &b.Func.Config.Types
4476
4477
4478
4479 for {
4480 c := auxIntToFloat32(v.AuxInt)
4481 if !(config.ctxt.Flag_shared) {
4482 break
4483 }
4484 v.reset(Op386MOVSSconst2)
4485 v0 := b.NewValue0(v.Pos, Op386MOVSSconst1, typ.UInt32)
4486 v0.AuxInt = float32ToAuxInt(c)
4487 v.AddArg(v0)
4488 return true
4489 }
4490 return false
4491 }
4492 func rewriteValue386_Op386MOVSSload(v *Value) bool {
4493 v_1 := v.Args[1]
4494 v_0 := v.Args[0]
4495 b := v.Block
4496 config := b.Func.Config
4497
4498
4499
4500 for {
4501 off1 := auxIntToInt32(v.AuxInt)
4502 sym := auxToSym(v.Aux)
4503 if v_0.Op != Op386ADDLconst {
4504 break
4505 }
4506 off2 := auxIntToInt32(v_0.AuxInt)
4507 ptr := v_0.Args[0]
4508 mem := v_1
4509 if !(is32Bit(int64(off1) + int64(off2))) {
4510 break
4511 }
4512 v.reset(Op386MOVSSload)
4513 v.AuxInt = int32ToAuxInt(off1 + off2)
4514 v.Aux = symToAux(sym)
4515 v.AddArg2(ptr, mem)
4516 return true
4517 }
4518
4519
4520
4521 for {
4522 off1 := auxIntToInt32(v.AuxInt)
4523 sym1 := auxToSym(v.Aux)
4524 if v_0.Op != Op386LEAL {
4525 break
4526 }
4527 off2 := auxIntToInt32(v_0.AuxInt)
4528 sym2 := auxToSym(v_0.Aux)
4529 base := v_0.Args[0]
4530 mem := v_1
4531 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4532 break
4533 }
4534 v.reset(Op386MOVSSload)
4535 v.AuxInt = int32ToAuxInt(off1 + off2)
4536 v.Aux = symToAux(mergeSym(sym1, sym2))
4537 v.AddArg2(base, mem)
4538 return true
4539 }
4540 return false
4541 }
4542 func rewriteValue386_Op386MOVSSstore(v *Value) bool {
4543 v_2 := v.Args[2]
4544 v_1 := v.Args[1]
4545 v_0 := v.Args[0]
4546 b := v.Block
4547 config := b.Func.Config
4548
4549
4550
4551 for {
4552 off1 := auxIntToInt32(v.AuxInt)
4553 sym := auxToSym(v.Aux)
4554 if v_0.Op != Op386ADDLconst {
4555 break
4556 }
4557 off2 := auxIntToInt32(v_0.AuxInt)
4558 ptr := v_0.Args[0]
4559 val := v_1
4560 mem := v_2
4561 if !(is32Bit(int64(off1) + int64(off2))) {
4562 break
4563 }
4564 v.reset(Op386MOVSSstore)
4565 v.AuxInt = int32ToAuxInt(off1 + off2)
4566 v.Aux = symToAux(sym)
4567 v.AddArg3(ptr, val, mem)
4568 return true
4569 }
4570
4571
4572
4573 for {
4574 off1 := auxIntToInt32(v.AuxInt)
4575 sym1 := auxToSym(v.Aux)
4576 if v_0.Op != Op386LEAL {
4577 break
4578 }
4579 off2 := auxIntToInt32(v_0.AuxInt)
4580 sym2 := auxToSym(v_0.Aux)
4581 base := v_0.Args[0]
4582 val := v_1
4583 mem := v_2
4584 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4585 break
4586 }
4587 v.reset(Op386MOVSSstore)
4588 v.AuxInt = int32ToAuxInt(off1 + off2)
4589 v.Aux = symToAux(mergeSym(sym1, sym2))
4590 v.AddArg3(base, val, mem)
4591 return true
4592 }
4593 return false
4594 }
4595 func rewriteValue386_Op386MOVWLSX(v *Value) bool {
4596 v_0 := v.Args[0]
4597 b := v.Block
4598
4599
4600
4601 for {
4602 x := v_0
4603 if x.Op != Op386MOVWload {
4604 break
4605 }
4606 off := auxIntToInt32(x.AuxInt)
4607 sym := auxToSym(x.Aux)
4608 mem := x.Args[1]
4609 ptr := x.Args[0]
4610 if !(x.Uses == 1 && clobber(x)) {
4611 break
4612 }
4613 b = x.Block
4614 v0 := b.NewValue0(x.Pos, Op386MOVWLSXload, v.Type)
4615 v.copyOf(v0)
4616 v0.AuxInt = int32ToAuxInt(off)
4617 v0.Aux = symToAux(sym)
4618 v0.AddArg2(ptr, mem)
4619 return true
4620 }
4621
4622
4623
4624 for {
4625 if v_0.Op != Op386ANDLconst {
4626 break
4627 }
4628 c := auxIntToInt32(v_0.AuxInt)
4629 x := v_0.Args[0]
4630 if !(c&0x8000 == 0) {
4631 break
4632 }
4633 v.reset(Op386ANDLconst)
4634 v.AuxInt = int32ToAuxInt(c & 0x7fff)
4635 v.AddArg(x)
4636 return true
4637 }
4638 return false
4639 }
4640 func rewriteValue386_Op386MOVWLSXload(v *Value) bool {
4641 v_1 := v.Args[1]
4642 v_0 := v.Args[0]
4643 b := v.Block
4644 config := b.Func.Config
4645
4646
4647
4648 for {
4649 off := auxIntToInt32(v.AuxInt)
4650 sym := auxToSym(v.Aux)
4651 ptr := v_0
4652 if v_1.Op != Op386MOVWstore {
4653 break
4654 }
4655 off2 := auxIntToInt32(v_1.AuxInt)
4656 sym2 := auxToSym(v_1.Aux)
4657 x := v_1.Args[1]
4658 ptr2 := v_1.Args[0]
4659 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
4660 break
4661 }
4662 v.reset(Op386MOVWLSX)
4663 v.AddArg(x)
4664 return true
4665 }
4666
4667
4668
4669 for {
4670 off1 := auxIntToInt32(v.AuxInt)
4671 sym1 := auxToSym(v.Aux)
4672 if v_0.Op != Op386LEAL {
4673 break
4674 }
4675 off2 := auxIntToInt32(v_0.AuxInt)
4676 sym2 := auxToSym(v_0.Aux)
4677 base := v_0.Args[0]
4678 mem := v_1
4679 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4680 break
4681 }
4682 v.reset(Op386MOVWLSXload)
4683 v.AuxInt = int32ToAuxInt(off1 + off2)
4684 v.Aux = symToAux(mergeSym(sym1, sym2))
4685 v.AddArg2(base, mem)
4686 return true
4687 }
4688
4689
4690
4691 for {
4692 off := auxIntToInt32(v.AuxInt)
4693 sym := auxToSym(v.Aux)
4694 if v_0.Op != OpSB || !(symIsRO(sym)) {
4695 break
4696 }
4697 v.reset(Op386MOVLconst)
4698 v.AuxInt = int32ToAuxInt(int32(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
4699 return true
4700 }
4701 return false
4702 }
4703 func rewriteValue386_Op386MOVWLZX(v *Value) bool {
4704 v_0 := v.Args[0]
4705 b := v.Block
4706
4707
4708
4709 for {
4710 x := v_0
4711 if x.Op != Op386MOVWload {
4712 break
4713 }
4714 off := auxIntToInt32(x.AuxInt)
4715 sym := auxToSym(x.Aux)
4716 mem := x.Args[1]
4717 ptr := x.Args[0]
4718 if !(x.Uses == 1 && clobber(x)) {
4719 break
4720 }
4721 b = x.Block
4722 v0 := b.NewValue0(x.Pos, Op386MOVWload, v.Type)
4723 v.copyOf(v0)
4724 v0.AuxInt = int32ToAuxInt(off)
4725 v0.Aux = symToAux(sym)
4726 v0.AddArg2(ptr, mem)
4727 return true
4728 }
4729
4730
4731 for {
4732 if v_0.Op != Op386ANDLconst {
4733 break
4734 }
4735 c := auxIntToInt32(v_0.AuxInt)
4736 x := v_0.Args[0]
4737 v.reset(Op386ANDLconst)
4738 v.AuxInt = int32ToAuxInt(c & 0xffff)
4739 v.AddArg(x)
4740 return true
4741 }
4742 return false
4743 }
4744 func rewriteValue386_Op386MOVWload(v *Value) bool {
4745 v_1 := v.Args[1]
4746 v_0 := v.Args[0]
4747 b := v.Block
4748 config := b.Func.Config
4749
4750
4751
4752 for {
4753 off := auxIntToInt32(v.AuxInt)
4754 sym := auxToSym(v.Aux)
4755 ptr := v_0
4756 if v_1.Op != Op386MOVWstore {
4757 break
4758 }
4759 off2 := auxIntToInt32(v_1.AuxInt)
4760 sym2 := auxToSym(v_1.Aux)
4761 x := v_1.Args[1]
4762 ptr2 := v_1.Args[0]
4763 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
4764 break
4765 }
4766 v.reset(Op386MOVWLZX)
4767 v.AddArg(x)
4768 return true
4769 }
4770
4771
4772
4773 for {
4774 off1 := auxIntToInt32(v.AuxInt)
4775 sym := auxToSym(v.Aux)
4776 if v_0.Op != Op386ADDLconst {
4777 break
4778 }
4779 off2 := auxIntToInt32(v_0.AuxInt)
4780 ptr := v_0.Args[0]
4781 mem := v_1
4782 if !(is32Bit(int64(off1) + int64(off2))) {
4783 break
4784 }
4785 v.reset(Op386MOVWload)
4786 v.AuxInt = int32ToAuxInt(off1 + off2)
4787 v.Aux = symToAux(sym)
4788 v.AddArg2(ptr, mem)
4789 return true
4790 }
4791
4792
4793
4794 for {
4795 off1 := auxIntToInt32(v.AuxInt)
4796 sym1 := auxToSym(v.Aux)
4797 if v_0.Op != Op386LEAL {
4798 break
4799 }
4800 off2 := auxIntToInt32(v_0.AuxInt)
4801 sym2 := auxToSym(v_0.Aux)
4802 base := v_0.Args[0]
4803 mem := v_1
4804 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4805 break
4806 }
4807 v.reset(Op386MOVWload)
4808 v.AuxInt = int32ToAuxInt(off1 + off2)
4809 v.Aux = symToAux(mergeSym(sym1, sym2))
4810 v.AddArg2(base, mem)
4811 return true
4812 }
4813
4814
4815
4816 for {
4817 off := auxIntToInt32(v.AuxInt)
4818 sym := auxToSym(v.Aux)
4819 if v_0.Op != OpSB || !(symIsRO(sym)) {
4820 break
4821 }
4822 v.reset(Op386MOVLconst)
4823 v.AuxInt = int32ToAuxInt(int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
4824 return true
4825 }
4826 return false
4827 }
4828 func rewriteValue386_Op386MOVWstore(v *Value) bool {
4829 v_2 := v.Args[2]
4830 v_1 := v.Args[1]
4831 v_0 := v.Args[0]
4832 b := v.Block
4833 config := b.Func.Config
4834
4835
4836 for {
4837 off := auxIntToInt32(v.AuxInt)
4838 sym := auxToSym(v.Aux)
4839 ptr := v_0
4840 if v_1.Op != Op386MOVWLSX {
4841 break
4842 }
4843 x := v_1.Args[0]
4844 mem := v_2
4845 v.reset(Op386MOVWstore)
4846 v.AuxInt = int32ToAuxInt(off)
4847 v.Aux = symToAux(sym)
4848 v.AddArg3(ptr, x, mem)
4849 return true
4850 }
4851
4852
4853 for {
4854 off := auxIntToInt32(v.AuxInt)
4855 sym := auxToSym(v.Aux)
4856 ptr := v_0
4857 if v_1.Op != Op386MOVWLZX {
4858 break
4859 }
4860 x := v_1.Args[0]
4861 mem := v_2
4862 v.reset(Op386MOVWstore)
4863 v.AuxInt = int32ToAuxInt(off)
4864 v.Aux = symToAux(sym)
4865 v.AddArg3(ptr, x, mem)
4866 return true
4867 }
4868
4869
4870
4871 for {
4872 off1 := auxIntToInt32(v.AuxInt)
4873 sym := auxToSym(v.Aux)
4874 if v_0.Op != Op386ADDLconst {
4875 break
4876 }
4877 off2 := auxIntToInt32(v_0.AuxInt)
4878 ptr := v_0.Args[0]
4879 val := v_1
4880 mem := v_2
4881 if !(is32Bit(int64(off1) + int64(off2))) {
4882 break
4883 }
4884 v.reset(Op386MOVWstore)
4885 v.AuxInt = int32ToAuxInt(off1 + off2)
4886 v.Aux = symToAux(sym)
4887 v.AddArg3(ptr, val, mem)
4888 return true
4889 }
4890
4891
4892 for {
4893 off := auxIntToInt32(v.AuxInt)
4894 sym := auxToSym(v.Aux)
4895 ptr := v_0
4896 if v_1.Op != Op386MOVLconst {
4897 break
4898 }
4899 c := auxIntToInt32(v_1.AuxInt)
4900 mem := v_2
4901 v.reset(Op386MOVWstoreconst)
4902 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4903 v.Aux = symToAux(sym)
4904 v.AddArg2(ptr, mem)
4905 return true
4906 }
4907
4908
4909
4910 for {
4911 off1 := auxIntToInt32(v.AuxInt)
4912 sym1 := auxToSym(v.Aux)
4913 if v_0.Op != Op386LEAL {
4914 break
4915 }
4916 off2 := auxIntToInt32(v_0.AuxInt)
4917 sym2 := auxToSym(v_0.Aux)
4918 base := v_0.Args[0]
4919 val := v_1
4920 mem := v_2
4921 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4922 break
4923 }
4924 v.reset(Op386MOVWstore)
4925 v.AuxInt = int32ToAuxInt(off1 + off2)
4926 v.Aux = symToAux(mergeSym(sym1, sym2))
4927 v.AddArg3(base, val, mem)
4928 return true
4929 }
4930 return false
4931 }
4932 func rewriteValue386_Op386MOVWstoreconst(v *Value) bool {
4933 v_1 := v.Args[1]
4934 v_0 := v.Args[0]
4935 b := v.Block
4936 config := b.Func.Config
4937
4938
4939
4940 for {
4941 sc := auxIntToValAndOff(v.AuxInt)
4942 s := auxToSym(v.Aux)
4943 if v_0.Op != Op386ADDLconst {
4944 break
4945 }
4946 off := auxIntToInt32(v_0.AuxInt)
4947 ptr := v_0.Args[0]
4948 mem := v_1
4949 if !(sc.canAdd32(off)) {
4950 break
4951 }
4952 v.reset(Op386MOVWstoreconst)
4953 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4954 v.Aux = symToAux(s)
4955 v.AddArg2(ptr, mem)
4956 return true
4957 }
4958
4959
4960
4961 for {
4962 sc := auxIntToValAndOff(v.AuxInt)
4963 sym1 := auxToSym(v.Aux)
4964 if v_0.Op != Op386LEAL {
4965 break
4966 }
4967 off := auxIntToInt32(v_0.AuxInt)
4968 sym2 := auxToSym(v_0.Aux)
4969 ptr := v_0.Args[0]
4970 mem := v_1
4971 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4972 break
4973 }
4974 v.reset(Op386MOVWstoreconst)
4975 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4976 v.Aux = symToAux(mergeSym(sym1, sym2))
4977 v.AddArg2(ptr, mem)
4978 return true
4979 }
4980 return false
4981 }
4982 func rewriteValue386_Op386MULL(v *Value) bool {
4983 v_1 := v.Args[1]
4984 v_0 := v.Args[0]
4985
4986
4987 for {
4988 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4989 x := v_0
4990 if v_1.Op != Op386MOVLconst {
4991 continue
4992 }
4993 c := auxIntToInt32(v_1.AuxInt)
4994 v.reset(Op386MULLconst)
4995 v.AuxInt = int32ToAuxInt(c)
4996 v.AddArg(x)
4997 return true
4998 }
4999 break
5000 }
5001
5002
5003
5004 for {
5005 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5006 x := v_0
5007 l := v_1
5008 if l.Op != Op386MOVLload {
5009 continue
5010 }
5011 off := auxIntToInt32(l.AuxInt)
5012 sym := auxToSym(l.Aux)
5013 mem := l.Args[1]
5014 ptr := l.Args[0]
5015 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5016 continue
5017 }
5018 v.reset(Op386MULLload)
5019 v.AuxInt = int32ToAuxInt(off)
5020 v.Aux = symToAux(sym)
5021 v.AddArg3(x, ptr, mem)
5022 return true
5023 }
5024 break
5025 }
5026 return false
5027 }
5028 func rewriteValue386_Op386MULLconst(v *Value) bool {
5029 v_0 := v.Args[0]
5030 b := v.Block
5031
5032
5033 for {
5034 c := auxIntToInt32(v.AuxInt)
5035 if v_0.Op != Op386MULLconst {
5036 break
5037 }
5038 d := auxIntToInt32(v_0.AuxInt)
5039 x := v_0.Args[0]
5040 v.reset(Op386MULLconst)
5041 v.AuxInt = int32ToAuxInt(c * d)
5042 v.AddArg(x)
5043 return true
5044 }
5045
5046
5047 for {
5048 if auxIntToInt32(v.AuxInt) != -9 {
5049 break
5050 }
5051 x := v_0
5052 v.reset(Op386NEGL)
5053 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5054 v0.AddArg2(x, x)
5055 v.AddArg(v0)
5056 return true
5057 }
5058
5059
5060 for {
5061 if auxIntToInt32(v.AuxInt) != -5 {
5062 break
5063 }
5064 x := v_0
5065 v.reset(Op386NEGL)
5066 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5067 v0.AddArg2(x, x)
5068 v.AddArg(v0)
5069 return true
5070 }
5071
5072
5073 for {
5074 if auxIntToInt32(v.AuxInt) != -3 {
5075 break
5076 }
5077 x := v_0
5078 v.reset(Op386NEGL)
5079 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5080 v0.AddArg2(x, x)
5081 v.AddArg(v0)
5082 return true
5083 }
5084
5085
5086 for {
5087 if auxIntToInt32(v.AuxInt) != -1 {
5088 break
5089 }
5090 x := v_0
5091 v.reset(Op386NEGL)
5092 v.AddArg(x)
5093 return true
5094 }
5095
5096
5097 for {
5098 if auxIntToInt32(v.AuxInt) != 0 {
5099 break
5100 }
5101 v.reset(Op386MOVLconst)
5102 v.AuxInt = int32ToAuxInt(0)
5103 return true
5104 }
5105
5106
5107 for {
5108 if auxIntToInt32(v.AuxInt) != 1 {
5109 break
5110 }
5111 x := v_0
5112 v.copyOf(x)
5113 return true
5114 }
5115
5116
5117 for {
5118 if auxIntToInt32(v.AuxInt) != 3 {
5119 break
5120 }
5121 x := v_0
5122 v.reset(Op386LEAL2)
5123 v.AddArg2(x, x)
5124 return true
5125 }
5126
5127
5128 for {
5129 if auxIntToInt32(v.AuxInt) != 5 {
5130 break
5131 }
5132 x := v_0
5133 v.reset(Op386LEAL4)
5134 v.AddArg2(x, x)
5135 return true
5136 }
5137
5138
5139 for {
5140 if auxIntToInt32(v.AuxInt) != 7 {
5141 break
5142 }
5143 x := v_0
5144 v.reset(Op386LEAL2)
5145 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5146 v0.AddArg2(x, x)
5147 v.AddArg2(x, v0)
5148 return true
5149 }
5150
5151
5152 for {
5153 if auxIntToInt32(v.AuxInt) != 9 {
5154 break
5155 }
5156 x := v_0
5157 v.reset(Op386LEAL8)
5158 v.AddArg2(x, x)
5159 return true
5160 }
5161
5162
5163 for {
5164 if auxIntToInt32(v.AuxInt) != 11 {
5165 break
5166 }
5167 x := v_0
5168 v.reset(Op386LEAL2)
5169 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5170 v0.AddArg2(x, x)
5171 v.AddArg2(x, v0)
5172 return true
5173 }
5174
5175
5176 for {
5177 if auxIntToInt32(v.AuxInt) != 13 {
5178 break
5179 }
5180 x := v_0
5181 v.reset(Op386LEAL4)
5182 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5183 v0.AddArg2(x, x)
5184 v.AddArg2(x, v0)
5185 return true
5186 }
5187
5188
5189 for {
5190 if auxIntToInt32(v.AuxInt) != 19 {
5191 break
5192 }
5193 x := v_0
5194 v.reset(Op386LEAL2)
5195 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5196 v0.AddArg2(x, x)
5197 v.AddArg2(x, v0)
5198 return true
5199 }
5200
5201
5202 for {
5203 if auxIntToInt32(v.AuxInt) != 21 {
5204 break
5205 }
5206 x := v_0
5207 v.reset(Op386LEAL4)
5208 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5209 v0.AddArg2(x, x)
5210 v.AddArg2(x, v0)
5211 return true
5212 }
5213
5214
5215 for {
5216 if auxIntToInt32(v.AuxInt) != 25 {
5217 break
5218 }
5219 x := v_0
5220 v.reset(Op386LEAL8)
5221 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5222 v0.AddArg2(x, x)
5223 v.AddArg2(x, v0)
5224 return true
5225 }
5226
5227
5228 for {
5229 if auxIntToInt32(v.AuxInt) != 27 {
5230 break
5231 }
5232 x := v_0
5233 v.reset(Op386LEAL8)
5234 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5235 v0.AddArg2(x, x)
5236 v.AddArg2(v0, v0)
5237 return true
5238 }
5239
5240
5241 for {
5242 if auxIntToInt32(v.AuxInt) != 37 {
5243 break
5244 }
5245 x := v_0
5246 v.reset(Op386LEAL4)
5247 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5248 v0.AddArg2(x, x)
5249 v.AddArg2(x, v0)
5250 return true
5251 }
5252
5253
5254 for {
5255 if auxIntToInt32(v.AuxInt) != 41 {
5256 break
5257 }
5258 x := v_0
5259 v.reset(Op386LEAL8)
5260 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5261 v0.AddArg2(x, x)
5262 v.AddArg2(x, v0)
5263 return true
5264 }
5265
5266
5267 for {
5268 if auxIntToInt32(v.AuxInt) != 45 {
5269 break
5270 }
5271 x := v_0
5272 v.reset(Op386LEAL8)
5273 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5274 v0.AddArg2(x, x)
5275 v.AddArg2(v0, v0)
5276 return true
5277 }
5278
5279
5280 for {
5281 if auxIntToInt32(v.AuxInt) != 73 {
5282 break
5283 }
5284 x := v_0
5285 v.reset(Op386LEAL8)
5286 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5287 v0.AddArg2(x, x)
5288 v.AddArg2(x, v0)
5289 return true
5290 }
5291
5292
5293 for {
5294 if auxIntToInt32(v.AuxInt) != 81 {
5295 break
5296 }
5297 x := v_0
5298 v.reset(Op386LEAL8)
5299 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5300 v0.AddArg2(x, x)
5301 v.AddArg2(v0, v0)
5302 return true
5303 }
5304
5305
5306
5307 for {
5308 c := auxIntToInt32(v.AuxInt)
5309 x := v_0
5310 if !(isPowerOfTwo(c+1) && c >= 15) {
5311 break
5312 }
5313 v.reset(Op386SUBL)
5314 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5315 v0.AuxInt = int32ToAuxInt(int32(log32(c + 1)))
5316 v0.AddArg(x)
5317 v.AddArg2(v0, x)
5318 return true
5319 }
5320
5321
5322
5323 for {
5324 c := auxIntToInt32(v.AuxInt)
5325 x := v_0
5326 if !(isPowerOfTwo(c-1) && c >= 17) {
5327 break
5328 }
5329 v.reset(Op386LEAL1)
5330 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5331 v0.AuxInt = int32ToAuxInt(int32(log32(c - 1)))
5332 v0.AddArg(x)
5333 v.AddArg2(v0, x)
5334 return true
5335 }
5336
5337
5338
5339 for {
5340 c := auxIntToInt32(v.AuxInt)
5341 x := v_0
5342 if !(isPowerOfTwo(c-2) && c >= 34) {
5343 break
5344 }
5345 v.reset(Op386LEAL2)
5346 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5347 v0.AuxInt = int32ToAuxInt(int32(log32(c - 2)))
5348 v0.AddArg(x)
5349 v.AddArg2(v0, x)
5350 return true
5351 }
5352
5353
5354
5355 for {
5356 c := auxIntToInt32(v.AuxInt)
5357 x := v_0
5358 if !(isPowerOfTwo(c-4) && c >= 68) {
5359 break
5360 }
5361 v.reset(Op386LEAL4)
5362 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5363 v0.AuxInt = int32ToAuxInt(int32(log32(c - 4)))
5364 v0.AddArg(x)
5365 v.AddArg2(v0, x)
5366 return true
5367 }
5368
5369
5370
5371 for {
5372 c := auxIntToInt32(v.AuxInt)
5373 x := v_0
5374 if !(isPowerOfTwo(c-8) && c >= 136) {
5375 break
5376 }
5377 v.reset(Op386LEAL8)
5378 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5379 v0.AuxInt = int32ToAuxInt(int32(log32(c - 8)))
5380 v0.AddArg(x)
5381 v.AddArg2(v0, x)
5382 return true
5383 }
5384
5385
5386
5387 for {
5388 c := auxIntToInt32(v.AuxInt)
5389 x := v_0
5390 if !(c%3 == 0 && isPowerOfTwo(c/3)) {
5391 break
5392 }
5393 v.reset(Op386SHLLconst)
5394 v.AuxInt = int32ToAuxInt(int32(log32(c / 3)))
5395 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5396 v0.AddArg2(x, x)
5397 v.AddArg(v0)
5398 return true
5399 }
5400
5401
5402
5403 for {
5404 c := auxIntToInt32(v.AuxInt)
5405 x := v_0
5406 if !(c%5 == 0 && isPowerOfTwo(c/5)) {
5407 break
5408 }
5409 v.reset(Op386SHLLconst)
5410 v.AuxInt = int32ToAuxInt(int32(log32(c / 5)))
5411 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5412 v0.AddArg2(x, x)
5413 v.AddArg(v0)
5414 return true
5415 }
5416
5417
5418
5419 for {
5420 c := auxIntToInt32(v.AuxInt)
5421 x := v_0
5422 if !(c%9 == 0 && isPowerOfTwo(c/9)) {
5423 break
5424 }
5425 v.reset(Op386SHLLconst)
5426 v.AuxInt = int32ToAuxInt(int32(log32(c / 9)))
5427 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5428 v0.AddArg2(x, x)
5429 v.AddArg(v0)
5430 return true
5431 }
5432
5433
5434 for {
5435 c := auxIntToInt32(v.AuxInt)
5436 if v_0.Op != Op386MOVLconst {
5437 break
5438 }
5439 d := auxIntToInt32(v_0.AuxInt)
5440 v.reset(Op386MOVLconst)
5441 v.AuxInt = int32ToAuxInt(c * d)
5442 return true
5443 }
5444 return false
5445 }
5446 func rewriteValue386_Op386MULLload(v *Value) bool {
5447 v_2 := v.Args[2]
5448 v_1 := v.Args[1]
5449 v_0 := v.Args[0]
5450 b := v.Block
5451 config := b.Func.Config
5452
5453
5454
5455 for {
5456 off1 := auxIntToInt32(v.AuxInt)
5457 sym := auxToSym(v.Aux)
5458 val := v_0
5459 if v_1.Op != Op386ADDLconst {
5460 break
5461 }
5462 off2 := auxIntToInt32(v_1.AuxInt)
5463 base := v_1.Args[0]
5464 mem := v_2
5465 if !(is32Bit(int64(off1) + int64(off2))) {
5466 break
5467 }
5468 v.reset(Op386MULLload)
5469 v.AuxInt = int32ToAuxInt(off1 + off2)
5470 v.Aux = symToAux(sym)
5471 v.AddArg3(val, base, mem)
5472 return true
5473 }
5474
5475
5476
5477 for {
5478 off1 := auxIntToInt32(v.AuxInt)
5479 sym1 := auxToSym(v.Aux)
5480 val := v_0
5481 if v_1.Op != Op386LEAL {
5482 break
5483 }
5484 off2 := auxIntToInt32(v_1.AuxInt)
5485 sym2 := auxToSym(v_1.Aux)
5486 base := v_1.Args[0]
5487 mem := v_2
5488 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5489 break
5490 }
5491 v.reset(Op386MULLload)
5492 v.AuxInt = int32ToAuxInt(off1 + off2)
5493 v.Aux = symToAux(mergeSym(sym1, sym2))
5494 v.AddArg3(val, base, mem)
5495 return true
5496 }
5497 return false
5498 }
5499 func rewriteValue386_Op386MULSD(v *Value) bool {
5500 v_1 := v.Args[1]
5501 v_0 := v.Args[0]
5502
5503
5504
5505 for {
5506 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5507 x := v_0
5508 l := v_1
5509 if l.Op != Op386MOVSDload {
5510 continue
5511 }
5512 off := auxIntToInt32(l.AuxInt)
5513 sym := auxToSym(l.Aux)
5514 mem := l.Args[1]
5515 ptr := l.Args[0]
5516 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5517 continue
5518 }
5519 v.reset(Op386MULSDload)
5520 v.AuxInt = int32ToAuxInt(off)
5521 v.Aux = symToAux(sym)
5522 v.AddArg3(x, ptr, mem)
5523 return true
5524 }
5525 break
5526 }
5527 return false
5528 }
5529 func rewriteValue386_Op386MULSDload(v *Value) bool {
5530 v_2 := v.Args[2]
5531 v_1 := v.Args[1]
5532 v_0 := v.Args[0]
5533 b := v.Block
5534 config := b.Func.Config
5535
5536
5537
5538 for {
5539 off1 := auxIntToInt32(v.AuxInt)
5540 sym := auxToSym(v.Aux)
5541 val := v_0
5542 if v_1.Op != Op386ADDLconst {
5543 break
5544 }
5545 off2 := auxIntToInt32(v_1.AuxInt)
5546 base := v_1.Args[0]
5547 mem := v_2
5548 if !(is32Bit(int64(off1) + int64(off2))) {
5549 break
5550 }
5551 v.reset(Op386MULSDload)
5552 v.AuxInt = int32ToAuxInt(off1 + off2)
5553 v.Aux = symToAux(sym)
5554 v.AddArg3(val, base, mem)
5555 return true
5556 }
5557
5558
5559
5560 for {
5561 off1 := auxIntToInt32(v.AuxInt)
5562 sym1 := auxToSym(v.Aux)
5563 val := v_0
5564 if v_1.Op != Op386LEAL {
5565 break
5566 }
5567 off2 := auxIntToInt32(v_1.AuxInt)
5568 sym2 := auxToSym(v_1.Aux)
5569 base := v_1.Args[0]
5570 mem := v_2
5571 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5572 break
5573 }
5574 v.reset(Op386MULSDload)
5575 v.AuxInt = int32ToAuxInt(off1 + off2)
5576 v.Aux = symToAux(mergeSym(sym1, sym2))
5577 v.AddArg3(val, base, mem)
5578 return true
5579 }
5580 return false
5581 }
5582 func rewriteValue386_Op386MULSS(v *Value) bool {
5583 v_1 := v.Args[1]
5584 v_0 := v.Args[0]
5585
5586
5587
5588 for {
5589 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5590 x := v_0
5591 l := v_1
5592 if l.Op != Op386MOVSSload {
5593 continue
5594 }
5595 off := auxIntToInt32(l.AuxInt)
5596 sym := auxToSym(l.Aux)
5597 mem := l.Args[1]
5598 ptr := l.Args[0]
5599 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5600 continue
5601 }
5602 v.reset(Op386MULSSload)
5603 v.AuxInt = int32ToAuxInt(off)
5604 v.Aux = symToAux(sym)
5605 v.AddArg3(x, ptr, mem)
5606 return true
5607 }
5608 break
5609 }
5610 return false
5611 }
5612 func rewriteValue386_Op386MULSSload(v *Value) bool {
5613 v_2 := v.Args[2]
5614 v_1 := v.Args[1]
5615 v_0 := v.Args[0]
5616 b := v.Block
5617 config := b.Func.Config
5618
5619
5620
5621 for {
5622 off1 := auxIntToInt32(v.AuxInt)
5623 sym := auxToSym(v.Aux)
5624 val := v_0
5625 if v_1.Op != Op386ADDLconst {
5626 break
5627 }
5628 off2 := auxIntToInt32(v_1.AuxInt)
5629 base := v_1.Args[0]
5630 mem := v_2
5631 if !(is32Bit(int64(off1) + int64(off2))) {
5632 break
5633 }
5634 v.reset(Op386MULSSload)
5635 v.AuxInt = int32ToAuxInt(off1 + off2)
5636 v.Aux = symToAux(sym)
5637 v.AddArg3(val, base, mem)
5638 return true
5639 }
5640
5641
5642
5643 for {
5644 off1 := auxIntToInt32(v.AuxInt)
5645 sym1 := auxToSym(v.Aux)
5646 val := v_0
5647 if v_1.Op != Op386LEAL {
5648 break
5649 }
5650 off2 := auxIntToInt32(v_1.AuxInt)
5651 sym2 := auxToSym(v_1.Aux)
5652 base := v_1.Args[0]
5653 mem := v_2
5654 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5655 break
5656 }
5657 v.reset(Op386MULSSload)
5658 v.AuxInt = int32ToAuxInt(off1 + off2)
5659 v.Aux = symToAux(mergeSym(sym1, sym2))
5660 v.AddArg3(val, base, mem)
5661 return true
5662 }
5663 return false
5664 }
5665 func rewriteValue386_Op386NEGL(v *Value) bool {
5666 v_0 := v.Args[0]
5667
5668
5669 for {
5670 if v_0.Op != Op386MOVLconst {
5671 break
5672 }
5673 c := auxIntToInt32(v_0.AuxInt)
5674 v.reset(Op386MOVLconst)
5675 v.AuxInt = int32ToAuxInt(-c)
5676 return true
5677 }
5678 return false
5679 }
5680 func rewriteValue386_Op386NOTL(v *Value) bool {
5681 v_0 := v.Args[0]
5682
5683
5684 for {
5685 if v_0.Op != Op386MOVLconst {
5686 break
5687 }
5688 c := auxIntToInt32(v_0.AuxInt)
5689 v.reset(Op386MOVLconst)
5690 v.AuxInt = int32ToAuxInt(^c)
5691 return true
5692 }
5693 return false
5694 }
5695 func rewriteValue386_Op386ORL(v *Value) bool {
5696 v_1 := v.Args[1]
5697 v_0 := v.Args[0]
5698
5699
5700 for {
5701 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5702 x := v_0
5703 if v_1.Op != Op386MOVLconst {
5704 continue
5705 }
5706 c := auxIntToInt32(v_1.AuxInt)
5707 v.reset(Op386ORLconst)
5708 v.AuxInt = int32ToAuxInt(c)
5709 v.AddArg(x)
5710 return true
5711 }
5712 break
5713 }
5714
5715
5716
5717 for {
5718 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5719 x := v_0
5720 l := v_1
5721 if l.Op != Op386MOVLload {
5722 continue
5723 }
5724 off := auxIntToInt32(l.AuxInt)
5725 sym := auxToSym(l.Aux)
5726 mem := l.Args[1]
5727 ptr := l.Args[0]
5728 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5729 continue
5730 }
5731 v.reset(Op386ORLload)
5732 v.AuxInt = int32ToAuxInt(off)
5733 v.Aux = symToAux(sym)
5734 v.AddArg3(x, ptr, mem)
5735 return true
5736 }
5737 break
5738 }
5739
5740
5741 for {
5742 x := v_0
5743 if x != v_1 {
5744 break
5745 }
5746 v.copyOf(x)
5747 return true
5748 }
5749 return false
5750 }
5751 func rewriteValue386_Op386ORLconst(v *Value) bool {
5752 v_0 := v.Args[0]
5753
5754
5755
5756 for {
5757 c := auxIntToInt32(v.AuxInt)
5758 x := v_0
5759 if !(c == 0) {
5760 break
5761 }
5762 v.copyOf(x)
5763 return true
5764 }
5765
5766
5767
5768 for {
5769 c := auxIntToInt32(v.AuxInt)
5770 if !(c == -1) {
5771 break
5772 }
5773 v.reset(Op386MOVLconst)
5774 v.AuxInt = int32ToAuxInt(-1)
5775 return true
5776 }
5777
5778
5779 for {
5780 c := auxIntToInt32(v.AuxInt)
5781 if v_0.Op != Op386MOVLconst {
5782 break
5783 }
5784 d := auxIntToInt32(v_0.AuxInt)
5785 v.reset(Op386MOVLconst)
5786 v.AuxInt = int32ToAuxInt(c | d)
5787 return true
5788 }
5789 return false
5790 }
5791 func rewriteValue386_Op386ORLconstmodify(v *Value) bool {
5792 v_1 := v.Args[1]
5793 v_0 := v.Args[0]
5794 b := v.Block
5795 config := b.Func.Config
5796
5797
5798
5799 for {
5800 valoff1 := auxIntToValAndOff(v.AuxInt)
5801 sym := auxToSym(v.Aux)
5802 if v_0.Op != Op386ADDLconst {
5803 break
5804 }
5805 off2 := auxIntToInt32(v_0.AuxInt)
5806 base := v_0.Args[0]
5807 mem := v_1
5808 if !(valoff1.canAdd32(off2)) {
5809 break
5810 }
5811 v.reset(Op386ORLconstmodify)
5812 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
5813 v.Aux = symToAux(sym)
5814 v.AddArg2(base, mem)
5815 return true
5816 }
5817
5818
5819
5820 for {
5821 valoff1 := auxIntToValAndOff(v.AuxInt)
5822 sym1 := auxToSym(v.Aux)
5823 if v_0.Op != Op386LEAL {
5824 break
5825 }
5826 off2 := auxIntToInt32(v_0.AuxInt)
5827 sym2 := auxToSym(v_0.Aux)
5828 base := v_0.Args[0]
5829 mem := v_1
5830 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5831 break
5832 }
5833 v.reset(Op386ORLconstmodify)
5834 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
5835 v.Aux = symToAux(mergeSym(sym1, sym2))
5836 v.AddArg2(base, mem)
5837 return true
5838 }
5839 return false
5840 }
5841 func rewriteValue386_Op386ORLload(v *Value) bool {
5842 v_2 := v.Args[2]
5843 v_1 := v.Args[1]
5844 v_0 := v.Args[0]
5845 b := v.Block
5846 config := b.Func.Config
5847
5848
5849
5850 for {
5851 off1 := auxIntToInt32(v.AuxInt)
5852 sym := auxToSym(v.Aux)
5853 val := v_0
5854 if v_1.Op != Op386ADDLconst {
5855 break
5856 }
5857 off2 := auxIntToInt32(v_1.AuxInt)
5858 base := v_1.Args[0]
5859 mem := v_2
5860 if !(is32Bit(int64(off1) + int64(off2))) {
5861 break
5862 }
5863 v.reset(Op386ORLload)
5864 v.AuxInt = int32ToAuxInt(off1 + off2)
5865 v.Aux = symToAux(sym)
5866 v.AddArg3(val, base, mem)
5867 return true
5868 }
5869
5870
5871
5872 for {
5873 off1 := auxIntToInt32(v.AuxInt)
5874 sym1 := auxToSym(v.Aux)
5875 val := v_0
5876 if v_1.Op != Op386LEAL {
5877 break
5878 }
5879 off2 := auxIntToInt32(v_1.AuxInt)
5880 sym2 := auxToSym(v_1.Aux)
5881 base := v_1.Args[0]
5882 mem := v_2
5883 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5884 break
5885 }
5886 v.reset(Op386ORLload)
5887 v.AuxInt = int32ToAuxInt(off1 + off2)
5888 v.Aux = symToAux(mergeSym(sym1, sym2))
5889 v.AddArg3(val, base, mem)
5890 return true
5891 }
5892 return false
5893 }
5894 func rewriteValue386_Op386ORLmodify(v *Value) bool {
5895 v_2 := v.Args[2]
5896 v_1 := v.Args[1]
5897 v_0 := v.Args[0]
5898 b := v.Block
5899 config := b.Func.Config
5900
5901
5902
5903 for {
5904 off1 := auxIntToInt32(v.AuxInt)
5905 sym := auxToSym(v.Aux)
5906 if v_0.Op != Op386ADDLconst {
5907 break
5908 }
5909 off2 := auxIntToInt32(v_0.AuxInt)
5910 base := v_0.Args[0]
5911 val := v_1
5912 mem := v_2
5913 if !(is32Bit(int64(off1) + int64(off2))) {
5914 break
5915 }
5916 v.reset(Op386ORLmodify)
5917 v.AuxInt = int32ToAuxInt(off1 + off2)
5918 v.Aux = symToAux(sym)
5919 v.AddArg3(base, val, mem)
5920 return true
5921 }
5922
5923
5924
5925 for {
5926 off1 := auxIntToInt32(v.AuxInt)
5927 sym1 := auxToSym(v.Aux)
5928 if v_0.Op != Op386LEAL {
5929 break
5930 }
5931 off2 := auxIntToInt32(v_0.AuxInt)
5932 sym2 := auxToSym(v_0.Aux)
5933 base := v_0.Args[0]
5934 val := v_1
5935 mem := v_2
5936 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5937 break
5938 }
5939 v.reset(Op386ORLmodify)
5940 v.AuxInt = int32ToAuxInt(off1 + off2)
5941 v.Aux = symToAux(mergeSym(sym1, sym2))
5942 v.AddArg3(base, val, mem)
5943 return true
5944 }
5945 return false
5946 }
5947 func rewriteValue386_Op386ROLB(v *Value) bool {
5948 v_1 := v.Args[1]
5949 v_0 := v.Args[0]
5950
5951
5952 for {
5953 x := v_0
5954 if v_1.Op != Op386MOVLconst {
5955 break
5956 }
5957 c := auxIntToInt32(v_1.AuxInt)
5958 v.reset(Op386ROLBconst)
5959 v.AuxInt = int8ToAuxInt(int8(c & 7))
5960 v.AddArg(x)
5961 return true
5962 }
5963 return false
5964 }
5965 func rewriteValue386_Op386ROLBconst(v *Value) bool {
5966 v_0 := v.Args[0]
5967
5968
5969 for {
5970 if auxIntToInt8(v.AuxInt) != 0 {
5971 break
5972 }
5973 x := v_0
5974 v.copyOf(x)
5975 return true
5976 }
5977 return false
5978 }
5979 func rewriteValue386_Op386ROLL(v *Value) bool {
5980 v_1 := v.Args[1]
5981 v_0 := v.Args[0]
5982
5983
5984 for {
5985 x := v_0
5986 if v_1.Op != Op386MOVLconst {
5987 break
5988 }
5989 c := auxIntToInt32(v_1.AuxInt)
5990 v.reset(Op386ROLLconst)
5991 v.AuxInt = int32ToAuxInt(c & 31)
5992 v.AddArg(x)
5993 return true
5994 }
5995 return false
5996 }
5997 func rewriteValue386_Op386ROLLconst(v *Value) bool {
5998 v_0 := v.Args[0]
5999
6000
6001 for {
6002 if auxIntToInt32(v.AuxInt) != 0 {
6003 break
6004 }
6005 x := v_0
6006 v.copyOf(x)
6007 return true
6008 }
6009 return false
6010 }
6011 func rewriteValue386_Op386ROLW(v *Value) bool {
6012 v_1 := v.Args[1]
6013 v_0 := v.Args[0]
6014
6015
6016 for {
6017 x := v_0
6018 if v_1.Op != Op386MOVLconst {
6019 break
6020 }
6021 c := auxIntToInt32(v_1.AuxInt)
6022 v.reset(Op386ROLWconst)
6023 v.AuxInt = int16ToAuxInt(int16(c & 15))
6024 v.AddArg(x)
6025 return true
6026 }
6027 return false
6028 }
6029 func rewriteValue386_Op386ROLWconst(v *Value) bool {
6030 v_0 := v.Args[0]
6031
6032
6033 for {
6034 if auxIntToInt16(v.AuxInt) != 0 {
6035 break
6036 }
6037 x := v_0
6038 v.copyOf(x)
6039 return true
6040 }
6041 return false
6042 }
6043 func rewriteValue386_Op386SARB(v *Value) bool {
6044 v_1 := v.Args[1]
6045 v_0 := v.Args[0]
6046
6047
6048 for {
6049 x := v_0
6050 if v_1.Op != Op386MOVLconst {
6051 break
6052 }
6053 c := auxIntToInt32(v_1.AuxInt)
6054 v.reset(Op386SARBconst)
6055 v.AuxInt = int8ToAuxInt(int8(min(int64(c&31), 7)))
6056 v.AddArg(x)
6057 return true
6058 }
6059 return false
6060 }
6061 func rewriteValue386_Op386SARBconst(v *Value) bool {
6062 v_0 := v.Args[0]
6063
6064
6065 for {
6066 if auxIntToInt8(v.AuxInt) != 0 {
6067 break
6068 }
6069 x := v_0
6070 v.copyOf(x)
6071 return true
6072 }
6073
6074
6075 for {
6076 c := auxIntToInt8(v.AuxInt)
6077 if v_0.Op != Op386MOVLconst {
6078 break
6079 }
6080 d := auxIntToInt32(v_0.AuxInt)
6081 v.reset(Op386MOVLconst)
6082 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6083 return true
6084 }
6085 return false
6086 }
6087 func rewriteValue386_Op386SARL(v *Value) bool {
6088 v_1 := v.Args[1]
6089 v_0 := v.Args[0]
6090
6091
6092 for {
6093 x := v_0
6094 if v_1.Op != Op386MOVLconst {
6095 break
6096 }
6097 c := auxIntToInt32(v_1.AuxInt)
6098 v.reset(Op386SARLconst)
6099 v.AuxInt = int32ToAuxInt(c & 31)
6100 v.AddArg(x)
6101 return true
6102 }
6103
6104
6105 for {
6106 x := v_0
6107 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
6108 break
6109 }
6110 y := v_1.Args[0]
6111 v.reset(Op386SARL)
6112 v.AddArg2(x, y)
6113 return true
6114 }
6115 return false
6116 }
6117 func rewriteValue386_Op386SARLconst(v *Value) bool {
6118 v_0 := v.Args[0]
6119
6120
6121 for {
6122 if auxIntToInt32(v.AuxInt) != 0 {
6123 break
6124 }
6125 x := v_0
6126 v.copyOf(x)
6127 return true
6128 }
6129
6130
6131 for {
6132 c := auxIntToInt32(v.AuxInt)
6133 if v_0.Op != Op386MOVLconst {
6134 break
6135 }
6136 d := auxIntToInt32(v_0.AuxInt)
6137 v.reset(Op386MOVLconst)
6138 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6139 return true
6140 }
6141 return false
6142 }
6143 func rewriteValue386_Op386SARW(v *Value) bool {
6144 v_1 := v.Args[1]
6145 v_0 := v.Args[0]
6146
6147
6148 for {
6149 x := v_0
6150 if v_1.Op != Op386MOVLconst {
6151 break
6152 }
6153 c := auxIntToInt32(v_1.AuxInt)
6154 v.reset(Op386SARWconst)
6155 v.AuxInt = int16ToAuxInt(int16(min(int64(c&31), 15)))
6156 v.AddArg(x)
6157 return true
6158 }
6159 return false
6160 }
6161 func rewriteValue386_Op386SARWconst(v *Value) bool {
6162 v_0 := v.Args[0]
6163
6164
6165 for {
6166 if auxIntToInt16(v.AuxInt) != 0 {
6167 break
6168 }
6169 x := v_0
6170 v.copyOf(x)
6171 return true
6172 }
6173
6174
6175 for {
6176 c := auxIntToInt16(v.AuxInt)
6177 if v_0.Op != Op386MOVLconst {
6178 break
6179 }
6180 d := auxIntToInt32(v_0.AuxInt)
6181 v.reset(Op386MOVLconst)
6182 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6183 return true
6184 }
6185 return false
6186 }
6187 func rewriteValue386_Op386SBBL(v *Value) bool {
6188 v_2 := v.Args[2]
6189 v_1 := v.Args[1]
6190 v_0 := v.Args[0]
6191
6192
6193 for {
6194 x := v_0
6195 if v_1.Op != Op386MOVLconst {
6196 break
6197 }
6198 c := auxIntToInt32(v_1.AuxInt)
6199 f := v_2
6200 v.reset(Op386SBBLconst)
6201 v.AuxInt = int32ToAuxInt(c)
6202 v.AddArg2(x, f)
6203 return true
6204 }
6205 return false
6206 }
6207 func rewriteValue386_Op386SBBLcarrymask(v *Value) bool {
6208 v_0 := v.Args[0]
6209
6210
6211 for {
6212 if v_0.Op != Op386FlagEQ {
6213 break
6214 }
6215 v.reset(Op386MOVLconst)
6216 v.AuxInt = int32ToAuxInt(0)
6217 return true
6218 }
6219
6220
6221 for {
6222 if v_0.Op != Op386FlagLT_ULT {
6223 break
6224 }
6225 v.reset(Op386MOVLconst)
6226 v.AuxInt = int32ToAuxInt(-1)
6227 return true
6228 }
6229
6230
6231 for {
6232 if v_0.Op != Op386FlagLT_UGT {
6233 break
6234 }
6235 v.reset(Op386MOVLconst)
6236 v.AuxInt = int32ToAuxInt(0)
6237 return true
6238 }
6239
6240
6241 for {
6242 if v_0.Op != Op386FlagGT_ULT {
6243 break
6244 }
6245 v.reset(Op386MOVLconst)
6246 v.AuxInt = int32ToAuxInt(-1)
6247 return true
6248 }
6249
6250
6251 for {
6252 if v_0.Op != Op386FlagGT_UGT {
6253 break
6254 }
6255 v.reset(Op386MOVLconst)
6256 v.AuxInt = int32ToAuxInt(0)
6257 return true
6258 }
6259 return false
6260 }
6261 func rewriteValue386_Op386SETA(v *Value) bool {
6262 v_0 := v.Args[0]
6263
6264
6265 for {
6266 if v_0.Op != Op386InvertFlags {
6267 break
6268 }
6269 x := v_0.Args[0]
6270 v.reset(Op386SETB)
6271 v.AddArg(x)
6272 return true
6273 }
6274
6275
6276 for {
6277 if v_0.Op != Op386FlagEQ {
6278 break
6279 }
6280 v.reset(Op386MOVLconst)
6281 v.AuxInt = int32ToAuxInt(0)
6282 return true
6283 }
6284
6285
6286 for {
6287 if v_0.Op != Op386FlagLT_ULT {
6288 break
6289 }
6290 v.reset(Op386MOVLconst)
6291 v.AuxInt = int32ToAuxInt(0)
6292 return true
6293 }
6294
6295
6296 for {
6297 if v_0.Op != Op386FlagLT_UGT {
6298 break
6299 }
6300 v.reset(Op386MOVLconst)
6301 v.AuxInt = int32ToAuxInt(1)
6302 return true
6303 }
6304
6305
6306 for {
6307 if v_0.Op != Op386FlagGT_ULT {
6308 break
6309 }
6310 v.reset(Op386MOVLconst)
6311 v.AuxInt = int32ToAuxInt(0)
6312 return true
6313 }
6314
6315
6316 for {
6317 if v_0.Op != Op386FlagGT_UGT {
6318 break
6319 }
6320 v.reset(Op386MOVLconst)
6321 v.AuxInt = int32ToAuxInt(1)
6322 return true
6323 }
6324 return false
6325 }
6326 func rewriteValue386_Op386SETAE(v *Value) bool {
6327 v_0 := v.Args[0]
6328
6329
6330 for {
6331 if v_0.Op != Op386InvertFlags {
6332 break
6333 }
6334 x := v_0.Args[0]
6335 v.reset(Op386SETBE)
6336 v.AddArg(x)
6337 return true
6338 }
6339
6340
6341 for {
6342 if v_0.Op != Op386FlagEQ {
6343 break
6344 }
6345 v.reset(Op386MOVLconst)
6346 v.AuxInt = int32ToAuxInt(1)
6347 return true
6348 }
6349
6350
6351 for {
6352 if v_0.Op != Op386FlagLT_ULT {
6353 break
6354 }
6355 v.reset(Op386MOVLconst)
6356 v.AuxInt = int32ToAuxInt(0)
6357 return true
6358 }
6359
6360
6361 for {
6362 if v_0.Op != Op386FlagLT_UGT {
6363 break
6364 }
6365 v.reset(Op386MOVLconst)
6366 v.AuxInt = int32ToAuxInt(1)
6367 return true
6368 }
6369
6370
6371 for {
6372 if v_0.Op != Op386FlagGT_ULT {
6373 break
6374 }
6375 v.reset(Op386MOVLconst)
6376 v.AuxInt = int32ToAuxInt(0)
6377 return true
6378 }
6379
6380
6381 for {
6382 if v_0.Op != Op386FlagGT_UGT {
6383 break
6384 }
6385 v.reset(Op386MOVLconst)
6386 v.AuxInt = int32ToAuxInt(1)
6387 return true
6388 }
6389 return false
6390 }
6391 func rewriteValue386_Op386SETB(v *Value) bool {
6392 v_0 := v.Args[0]
6393
6394
6395 for {
6396 if v_0.Op != Op386InvertFlags {
6397 break
6398 }
6399 x := v_0.Args[0]
6400 v.reset(Op386SETA)
6401 v.AddArg(x)
6402 return true
6403 }
6404
6405
6406 for {
6407 if v_0.Op != Op386FlagEQ {
6408 break
6409 }
6410 v.reset(Op386MOVLconst)
6411 v.AuxInt = int32ToAuxInt(0)
6412 return true
6413 }
6414
6415
6416 for {
6417 if v_0.Op != Op386FlagLT_ULT {
6418 break
6419 }
6420 v.reset(Op386MOVLconst)
6421 v.AuxInt = int32ToAuxInt(1)
6422 return true
6423 }
6424
6425
6426 for {
6427 if v_0.Op != Op386FlagLT_UGT {
6428 break
6429 }
6430 v.reset(Op386MOVLconst)
6431 v.AuxInt = int32ToAuxInt(0)
6432 return true
6433 }
6434
6435
6436 for {
6437 if v_0.Op != Op386FlagGT_ULT {
6438 break
6439 }
6440 v.reset(Op386MOVLconst)
6441 v.AuxInt = int32ToAuxInt(1)
6442 return true
6443 }
6444
6445
6446 for {
6447 if v_0.Op != Op386FlagGT_UGT {
6448 break
6449 }
6450 v.reset(Op386MOVLconst)
6451 v.AuxInt = int32ToAuxInt(0)
6452 return true
6453 }
6454 return false
6455 }
6456 func rewriteValue386_Op386SETBE(v *Value) bool {
6457 v_0 := v.Args[0]
6458
6459
6460 for {
6461 if v_0.Op != Op386InvertFlags {
6462 break
6463 }
6464 x := v_0.Args[0]
6465 v.reset(Op386SETAE)
6466 v.AddArg(x)
6467 return true
6468 }
6469
6470
6471 for {
6472 if v_0.Op != Op386FlagEQ {
6473 break
6474 }
6475 v.reset(Op386MOVLconst)
6476 v.AuxInt = int32ToAuxInt(1)
6477 return true
6478 }
6479
6480
6481 for {
6482 if v_0.Op != Op386FlagLT_ULT {
6483 break
6484 }
6485 v.reset(Op386MOVLconst)
6486 v.AuxInt = int32ToAuxInt(1)
6487 return true
6488 }
6489
6490
6491 for {
6492 if v_0.Op != Op386FlagLT_UGT {
6493 break
6494 }
6495 v.reset(Op386MOVLconst)
6496 v.AuxInt = int32ToAuxInt(0)
6497 return true
6498 }
6499
6500
6501 for {
6502 if v_0.Op != Op386FlagGT_ULT {
6503 break
6504 }
6505 v.reset(Op386MOVLconst)
6506 v.AuxInt = int32ToAuxInt(1)
6507 return true
6508 }
6509
6510
6511 for {
6512 if v_0.Op != Op386FlagGT_UGT {
6513 break
6514 }
6515 v.reset(Op386MOVLconst)
6516 v.AuxInt = int32ToAuxInt(0)
6517 return true
6518 }
6519 return false
6520 }
6521 func rewriteValue386_Op386SETEQ(v *Value) bool {
6522 v_0 := v.Args[0]
6523
6524
6525 for {
6526 if v_0.Op != Op386InvertFlags {
6527 break
6528 }
6529 x := v_0.Args[0]
6530 v.reset(Op386SETEQ)
6531 v.AddArg(x)
6532 return true
6533 }
6534
6535
6536 for {
6537 if v_0.Op != Op386FlagEQ {
6538 break
6539 }
6540 v.reset(Op386MOVLconst)
6541 v.AuxInt = int32ToAuxInt(1)
6542 return true
6543 }
6544
6545
6546 for {
6547 if v_0.Op != Op386FlagLT_ULT {
6548 break
6549 }
6550 v.reset(Op386MOVLconst)
6551 v.AuxInt = int32ToAuxInt(0)
6552 return true
6553 }
6554
6555
6556 for {
6557 if v_0.Op != Op386FlagLT_UGT {
6558 break
6559 }
6560 v.reset(Op386MOVLconst)
6561 v.AuxInt = int32ToAuxInt(0)
6562 return true
6563 }
6564
6565
6566 for {
6567 if v_0.Op != Op386FlagGT_ULT {
6568 break
6569 }
6570 v.reset(Op386MOVLconst)
6571 v.AuxInt = int32ToAuxInt(0)
6572 return true
6573 }
6574
6575
6576 for {
6577 if v_0.Op != Op386FlagGT_UGT {
6578 break
6579 }
6580 v.reset(Op386MOVLconst)
6581 v.AuxInt = int32ToAuxInt(0)
6582 return true
6583 }
6584 return false
6585 }
6586 func rewriteValue386_Op386SETG(v *Value) bool {
6587 v_0 := v.Args[0]
6588
6589
6590 for {
6591 if v_0.Op != Op386InvertFlags {
6592 break
6593 }
6594 x := v_0.Args[0]
6595 v.reset(Op386SETL)
6596 v.AddArg(x)
6597 return true
6598 }
6599
6600
6601 for {
6602 if v_0.Op != Op386FlagEQ {
6603 break
6604 }
6605 v.reset(Op386MOVLconst)
6606 v.AuxInt = int32ToAuxInt(0)
6607 return true
6608 }
6609
6610
6611 for {
6612 if v_0.Op != Op386FlagLT_ULT {
6613 break
6614 }
6615 v.reset(Op386MOVLconst)
6616 v.AuxInt = int32ToAuxInt(0)
6617 return true
6618 }
6619
6620
6621 for {
6622 if v_0.Op != Op386FlagLT_UGT {
6623 break
6624 }
6625 v.reset(Op386MOVLconst)
6626 v.AuxInt = int32ToAuxInt(0)
6627 return true
6628 }
6629
6630
6631 for {
6632 if v_0.Op != Op386FlagGT_ULT {
6633 break
6634 }
6635 v.reset(Op386MOVLconst)
6636 v.AuxInt = int32ToAuxInt(1)
6637 return true
6638 }
6639
6640
6641 for {
6642 if v_0.Op != Op386FlagGT_UGT {
6643 break
6644 }
6645 v.reset(Op386MOVLconst)
6646 v.AuxInt = int32ToAuxInt(1)
6647 return true
6648 }
6649 return false
6650 }
6651 func rewriteValue386_Op386SETGE(v *Value) bool {
6652 v_0 := v.Args[0]
6653
6654
6655 for {
6656 if v_0.Op != Op386InvertFlags {
6657 break
6658 }
6659 x := v_0.Args[0]
6660 v.reset(Op386SETLE)
6661 v.AddArg(x)
6662 return true
6663 }
6664
6665
6666 for {
6667 if v_0.Op != Op386FlagEQ {
6668 break
6669 }
6670 v.reset(Op386MOVLconst)
6671 v.AuxInt = int32ToAuxInt(1)
6672 return true
6673 }
6674
6675
6676 for {
6677 if v_0.Op != Op386FlagLT_ULT {
6678 break
6679 }
6680 v.reset(Op386MOVLconst)
6681 v.AuxInt = int32ToAuxInt(0)
6682 return true
6683 }
6684
6685
6686 for {
6687 if v_0.Op != Op386FlagLT_UGT {
6688 break
6689 }
6690 v.reset(Op386MOVLconst)
6691 v.AuxInt = int32ToAuxInt(0)
6692 return true
6693 }
6694
6695
6696 for {
6697 if v_0.Op != Op386FlagGT_ULT {
6698 break
6699 }
6700 v.reset(Op386MOVLconst)
6701 v.AuxInt = int32ToAuxInt(1)
6702 return true
6703 }
6704
6705
6706 for {
6707 if v_0.Op != Op386FlagGT_UGT {
6708 break
6709 }
6710 v.reset(Op386MOVLconst)
6711 v.AuxInt = int32ToAuxInt(1)
6712 return true
6713 }
6714 return false
6715 }
6716 func rewriteValue386_Op386SETL(v *Value) bool {
6717 v_0 := v.Args[0]
6718
6719
6720 for {
6721 if v_0.Op != Op386InvertFlags {
6722 break
6723 }
6724 x := v_0.Args[0]
6725 v.reset(Op386SETG)
6726 v.AddArg(x)
6727 return true
6728 }
6729
6730
6731 for {
6732 if v_0.Op != Op386FlagEQ {
6733 break
6734 }
6735 v.reset(Op386MOVLconst)
6736 v.AuxInt = int32ToAuxInt(0)
6737 return true
6738 }
6739
6740
6741 for {
6742 if v_0.Op != Op386FlagLT_ULT {
6743 break
6744 }
6745 v.reset(Op386MOVLconst)
6746 v.AuxInt = int32ToAuxInt(1)
6747 return true
6748 }
6749
6750
6751 for {
6752 if v_0.Op != Op386FlagLT_UGT {
6753 break
6754 }
6755 v.reset(Op386MOVLconst)
6756 v.AuxInt = int32ToAuxInt(1)
6757 return true
6758 }
6759
6760
6761 for {
6762 if v_0.Op != Op386FlagGT_ULT {
6763 break
6764 }
6765 v.reset(Op386MOVLconst)
6766 v.AuxInt = int32ToAuxInt(0)
6767 return true
6768 }
6769
6770
6771 for {
6772 if v_0.Op != Op386FlagGT_UGT {
6773 break
6774 }
6775 v.reset(Op386MOVLconst)
6776 v.AuxInt = int32ToAuxInt(0)
6777 return true
6778 }
6779 return false
6780 }
6781 func rewriteValue386_Op386SETLE(v *Value) bool {
6782 v_0 := v.Args[0]
6783
6784
6785 for {
6786 if v_0.Op != Op386InvertFlags {
6787 break
6788 }
6789 x := v_0.Args[0]
6790 v.reset(Op386SETGE)
6791 v.AddArg(x)
6792 return true
6793 }
6794
6795
6796 for {
6797 if v_0.Op != Op386FlagEQ {
6798 break
6799 }
6800 v.reset(Op386MOVLconst)
6801 v.AuxInt = int32ToAuxInt(1)
6802 return true
6803 }
6804
6805
6806 for {
6807 if v_0.Op != Op386FlagLT_ULT {
6808 break
6809 }
6810 v.reset(Op386MOVLconst)
6811 v.AuxInt = int32ToAuxInt(1)
6812 return true
6813 }
6814
6815
6816 for {
6817 if v_0.Op != Op386FlagLT_UGT {
6818 break
6819 }
6820 v.reset(Op386MOVLconst)
6821 v.AuxInt = int32ToAuxInt(1)
6822 return true
6823 }
6824
6825
6826 for {
6827 if v_0.Op != Op386FlagGT_ULT {
6828 break
6829 }
6830 v.reset(Op386MOVLconst)
6831 v.AuxInt = int32ToAuxInt(0)
6832 return true
6833 }
6834
6835
6836 for {
6837 if v_0.Op != Op386FlagGT_UGT {
6838 break
6839 }
6840 v.reset(Op386MOVLconst)
6841 v.AuxInt = int32ToAuxInt(0)
6842 return true
6843 }
6844 return false
6845 }
6846 func rewriteValue386_Op386SETNE(v *Value) bool {
6847 v_0 := v.Args[0]
6848
6849
6850 for {
6851 if v_0.Op != Op386InvertFlags {
6852 break
6853 }
6854 x := v_0.Args[0]
6855 v.reset(Op386SETNE)
6856 v.AddArg(x)
6857 return true
6858 }
6859
6860
6861 for {
6862 if v_0.Op != Op386FlagEQ {
6863 break
6864 }
6865 v.reset(Op386MOVLconst)
6866 v.AuxInt = int32ToAuxInt(0)
6867 return true
6868 }
6869
6870
6871 for {
6872 if v_0.Op != Op386FlagLT_ULT {
6873 break
6874 }
6875 v.reset(Op386MOVLconst)
6876 v.AuxInt = int32ToAuxInt(1)
6877 return true
6878 }
6879
6880
6881 for {
6882 if v_0.Op != Op386FlagLT_UGT {
6883 break
6884 }
6885 v.reset(Op386MOVLconst)
6886 v.AuxInt = int32ToAuxInt(1)
6887 return true
6888 }
6889
6890
6891 for {
6892 if v_0.Op != Op386FlagGT_ULT {
6893 break
6894 }
6895 v.reset(Op386MOVLconst)
6896 v.AuxInt = int32ToAuxInt(1)
6897 return true
6898 }
6899
6900
6901 for {
6902 if v_0.Op != Op386FlagGT_UGT {
6903 break
6904 }
6905 v.reset(Op386MOVLconst)
6906 v.AuxInt = int32ToAuxInt(1)
6907 return true
6908 }
6909 return false
6910 }
6911 func rewriteValue386_Op386SHLL(v *Value) bool {
6912 v_1 := v.Args[1]
6913 v_0 := v.Args[0]
6914
6915
6916 for {
6917 x := v_0
6918 if v_1.Op != Op386MOVLconst {
6919 break
6920 }
6921 c := auxIntToInt32(v_1.AuxInt)
6922 v.reset(Op386SHLLconst)
6923 v.AuxInt = int32ToAuxInt(c & 31)
6924 v.AddArg(x)
6925 return true
6926 }
6927
6928
6929 for {
6930 x := v_0
6931 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
6932 break
6933 }
6934 y := v_1.Args[0]
6935 v.reset(Op386SHLL)
6936 v.AddArg2(x, y)
6937 return true
6938 }
6939 return false
6940 }
6941 func rewriteValue386_Op386SHLLconst(v *Value) bool {
6942 v_0 := v.Args[0]
6943
6944
6945 for {
6946 if auxIntToInt32(v.AuxInt) != 0 {
6947 break
6948 }
6949 x := v_0
6950 v.copyOf(x)
6951 return true
6952 }
6953 return false
6954 }
6955 func rewriteValue386_Op386SHRB(v *Value) bool {
6956 v_1 := v.Args[1]
6957 v_0 := v.Args[0]
6958
6959
6960
6961 for {
6962 x := v_0
6963 if v_1.Op != Op386MOVLconst {
6964 break
6965 }
6966 c := auxIntToInt32(v_1.AuxInt)
6967 if !(c&31 < 8) {
6968 break
6969 }
6970 v.reset(Op386SHRBconst)
6971 v.AuxInt = int8ToAuxInt(int8(c & 31))
6972 v.AddArg(x)
6973 return true
6974 }
6975
6976
6977
6978 for {
6979 if v_1.Op != Op386MOVLconst {
6980 break
6981 }
6982 c := auxIntToInt32(v_1.AuxInt)
6983 if !(c&31 >= 8) {
6984 break
6985 }
6986 v.reset(Op386MOVLconst)
6987 v.AuxInt = int32ToAuxInt(0)
6988 return true
6989 }
6990 return false
6991 }
6992 func rewriteValue386_Op386SHRBconst(v *Value) bool {
6993 v_0 := v.Args[0]
6994
6995
6996 for {
6997 if auxIntToInt8(v.AuxInt) != 0 {
6998 break
6999 }
7000 x := v_0
7001 v.copyOf(x)
7002 return true
7003 }
7004 return false
7005 }
7006 func rewriteValue386_Op386SHRL(v *Value) bool {
7007 v_1 := v.Args[1]
7008 v_0 := v.Args[0]
7009
7010
7011 for {
7012 x := v_0
7013 if v_1.Op != Op386MOVLconst {
7014 break
7015 }
7016 c := auxIntToInt32(v_1.AuxInt)
7017 v.reset(Op386SHRLconst)
7018 v.AuxInt = int32ToAuxInt(c & 31)
7019 v.AddArg(x)
7020 return true
7021 }
7022
7023
7024 for {
7025 x := v_0
7026 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
7027 break
7028 }
7029 y := v_1.Args[0]
7030 v.reset(Op386SHRL)
7031 v.AddArg2(x, y)
7032 return true
7033 }
7034 return false
7035 }
7036 func rewriteValue386_Op386SHRLconst(v *Value) bool {
7037 v_0 := v.Args[0]
7038
7039
7040 for {
7041 if auxIntToInt32(v.AuxInt) != 0 {
7042 break
7043 }
7044 x := v_0
7045 v.copyOf(x)
7046 return true
7047 }
7048 return false
7049 }
7050 func rewriteValue386_Op386SHRW(v *Value) bool {
7051 v_1 := v.Args[1]
7052 v_0 := v.Args[0]
7053
7054
7055
7056 for {
7057 x := v_0
7058 if v_1.Op != Op386MOVLconst {
7059 break
7060 }
7061 c := auxIntToInt32(v_1.AuxInt)
7062 if !(c&31 < 16) {
7063 break
7064 }
7065 v.reset(Op386SHRWconst)
7066 v.AuxInt = int16ToAuxInt(int16(c & 31))
7067 v.AddArg(x)
7068 return true
7069 }
7070
7071
7072
7073 for {
7074 if v_1.Op != Op386MOVLconst {
7075 break
7076 }
7077 c := auxIntToInt32(v_1.AuxInt)
7078 if !(c&31 >= 16) {
7079 break
7080 }
7081 v.reset(Op386MOVLconst)
7082 v.AuxInt = int32ToAuxInt(0)
7083 return true
7084 }
7085 return false
7086 }
7087 func rewriteValue386_Op386SHRWconst(v *Value) bool {
7088 v_0 := v.Args[0]
7089
7090
7091 for {
7092 if auxIntToInt16(v.AuxInt) != 0 {
7093 break
7094 }
7095 x := v_0
7096 v.copyOf(x)
7097 return true
7098 }
7099 return false
7100 }
7101 func rewriteValue386_Op386SUBL(v *Value) bool {
7102 v_1 := v.Args[1]
7103 v_0 := v.Args[0]
7104 b := v.Block
7105
7106
7107 for {
7108 x := v_0
7109 if v_1.Op != Op386MOVLconst {
7110 break
7111 }
7112 c := auxIntToInt32(v_1.AuxInt)
7113 v.reset(Op386SUBLconst)
7114 v.AuxInt = int32ToAuxInt(c)
7115 v.AddArg(x)
7116 return true
7117 }
7118
7119
7120 for {
7121 if v_0.Op != Op386MOVLconst {
7122 break
7123 }
7124 c := auxIntToInt32(v_0.AuxInt)
7125 x := v_1
7126 v.reset(Op386NEGL)
7127 v0 := b.NewValue0(v.Pos, Op386SUBLconst, v.Type)
7128 v0.AuxInt = int32ToAuxInt(c)
7129 v0.AddArg(x)
7130 v.AddArg(v0)
7131 return true
7132 }
7133
7134
7135
7136 for {
7137 x := v_0
7138 l := v_1
7139 if l.Op != Op386MOVLload {
7140 break
7141 }
7142 off := auxIntToInt32(l.AuxInt)
7143 sym := auxToSym(l.Aux)
7144 mem := l.Args[1]
7145 ptr := l.Args[0]
7146 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
7147 break
7148 }
7149 v.reset(Op386SUBLload)
7150 v.AuxInt = int32ToAuxInt(off)
7151 v.Aux = symToAux(sym)
7152 v.AddArg3(x, ptr, mem)
7153 return true
7154 }
7155
7156
7157 for {
7158 x := v_0
7159 if x != v_1 {
7160 break
7161 }
7162 v.reset(Op386MOVLconst)
7163 v.AuxInt = int32ToAuxInt(0)
7164 return true
7165 }
7166 return false
7167 }
7168 func rewriteValue386_Op386SUBLcarry(v *Value) bool {
7169 v_1 := v.Args[1]
7170 v_0 := v.Args[0]
7171
7172
7173 for {
7174 x := v_0
7175 if v_1.Op != Op386MOVLconst {
7176 break
7177 }
7178 c := auxIntToInt32(v_1.AuxInt)
7179 v.reset(Op386SUBLconstcarry)
7180 v.AuxInt = int32ToAuxInt(c)
7181 v.AddArg(x)
7182 return true
7183 }
7184 return false
7185 }
7186 func rewriteValue386_Op386SUBLconst(v *Value) bool {
7187 v_0 := v.Args[0]
7188
7189
7190
7191 for {
7192 c := auxIntToInt32(v.AuxInt)
7193 x := v_0
7194 if !(c == 0) {
7195 break
7196 }
7197 v.copyOf(x)
7198 return true
7199 }
7200
7201
7202 for {
7203 c := auxIntToInt32(v.AuxInt)
7204 x := v_0
7205 v.reset(Op386ADDLconst)
7206 v.AuxInt = int32ToAuxInt(-c)
7207 v.AddArg(x)
7208 return true
7209 }
7210 }
7211 func rewriteValue386_Op386SUBLload(v *Value) bool {
7212 v_2 := v.Args[2]
7213 v_1 := v.Args[1]
7214 v_0 := v.Args[0]
7215 b := v.Block
7216 config := b.Func.Config
7217
7218
7219
7220 for {
7221 off1 := auxIntToInt32(v.AuxInt)
7222 sym := auxToSym(v.Aux)
7223 val := v_0
7224 if v_1.Op != Op386ADDLconst {
7225 break
7226 }
7227 off2 := auxIntToInt32(v_1.AuxInt)
7228 base := v_1.Args[0]
7229 mem := v_2
7230 if !(is32Bit(int64(off1) + int64(off2))) {
7231 break
7232 }
7233 v.reset(Op386SUBLload)
7234 v.AuxInt = int32ToAuxInt(off1 + off2)
7235 v.Aux = symToAux(sym)
7236 v.AddArg3(val, base, mem)
7237 return true
7238 }
7239
7240
7241
7242 for {
7243 off1 := auxIntToInt32(v.AuxInt)
7244 sym1 := auxToSym(v.Aux)
7245 val := v_0
7246 if v_1.Op != Op386LEAL {
7247 break
7248 }
7249 off2 := auxIntToInt32(v_1.AuxInt)
7250 sym2 := auxToSym(v_1.Aux)
7251 base := v_1.Args[0]
7252 mem := v_2
7253 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7254 break
7255 }
7256 v.reset(Op386SUBLload)
7257 v.AuxInt = int32ToAuxInt(off1 + off2)
7258 v.Aux = symToAux(mergeSym(sym1, sym2))
7259 v.AddArg3(val, base, mem)
7260 return true
7261 }
7262 return false
7263 }
7264 func rewriteValue386_Op386SUBLmodify(v *Value) bool {
7265 v_2 := v.Args[2]
7266 v_1 := v.Args[1]
7267 v_0 := v.Args[0]
7268 b := v.Block
7269 config := b.Func.Config
7270
7271
7272
7273 for {
7274 off1 := auxIntToInt32(v.AuxInt)
7275 sym := auxToSym(v.Aux)
7276 if v_0.Op != Op386ADDLconst {
7277 break
7278 }
7279 off2 := auxIntToInt32(v_0.AuxInt)
7280 base := v_0.Args[0]
7281 val := v_1
7282 mem := v_2
7283 if !(is32Bit(int64(off1) + int64(off2))) {
7284 break
7285 }
7286 v.reset(Op386SUBLmodify)
7287 v.AuxInt = int32ToAuxInt(off1 + off2)
7288 v.Aux = symToAux(sym)
7289 v.AddArg3(base, val, mem)
7290 return true
7291 }
7292
7293
7294
7295 for {
7296 off1 := auxIntToInt32(v.AuxInt)
7297 sym1 := auxToSym(v.Aux)
7298 if v_0.Op != Op386LEAL {
7299 break
7300 }
7301 off2 := auxIntToInt32(v_0.AuxInt)
7302 sym2 := auxToSym(v_0.Aux)
7303 base := v_0.Args[0]
7304 val := v_1
7305 mem := v_2
7306 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7307 break
7308 }
7309 v.reset(Op386SUBLmodify)
7310 v.AuxInt = int32ToAuxInt(off1 + off2)
7311 v.Aux = symToAux(mergeSym(sym1, sym2))
7312 v.AddArg3(base, val, mem)
7313 return true
7314 }
7315 return false
7316 }
7317 func rewriteValue386_Op386SUBSD(v *Value) bool {
7318 v_1 := v.Args[1]
7319 v_0 := v.Args[0]
7320
7321
7322
7323 for {
7324 x := v_0
7325 l := v_1
7326 if l.Op != Op386MOVSDload {
7327 break
7328 }
7329 off := auxIntToInt32(l.AuxInt)
7330 sym := auxToSym(l.Aux)
7331 mem := l.Args[1]
7332 ptr := l.Args[0]
7333 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
7334 break
7335 }
7336 v.reset(Op386SUBSDload)
7337 v.AuxInt = int32ToAuxInt(off)
7338 v.Aux = symToAux(sym)
7339 v.AddArg3(x, ptr, mem)
7340 return true
7341 }
7342 return false
7343 }
7344 func rewriteValue386_Op386SUBSDload(v *Value) bool {
7345 v_2 := v.Args[2]
7346 v_1 := v.Args[1]
7347 v_0 := v.Args[0]
7348 b := v.Block
7349 config := b.Func.Config
7350
7351
7352
7353 for {
7354 off1 := auxIntToInt32(v.AuxInt)
7355 sym := auxToSym(v.Aux)
7356 val := v_0
7357 if v_1.Op != Op386ADDLconst {
7358 break
7359 }
7360 off2 := auxIntToInt32(v_1.AuxInt)
7361 base := v_1.Args[0]
7362 mem := v_2
7363 if !(is32Bit(int64(off1) + int64(off2))) {
7364 break
7365 }
7366 v.reset(Op386SUBSDload)
7367 v.AuxInt = int32ToAuxInt(off1 + off2)
7368 v.Aux = symToAux(sym)
7369 v.AddArg3(val, base, mem)
7370 return true
7371 }
7372
7373
7374
7375 for {
7376 off1 := auxIntToInt32(v.AuxInt)
7377 sym1 := auxToSym(v.Aux)
7378 val := v_0
7379 if v_1.Op != Op386LEAL {
7380 break
7381 }
7382 off2 := auxIntToInt32(v_1.AuxInt)
7383 sym2 := auxToSym(v_1.Aux)
7384 base := v_1.Args[0]
7385 mem := v_2
7386 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7387 break
7388 }
7389 v.reset(Op386SUBSDload)
7390 v.AuxInt = int32ToAuxInt(off1 + off2)
7391 v.Aux = symToAux(mergeSym(sym1, sym2))
7392 v.AddArg3(val, base, mem)
7393 return true
7394 }
7395 return false
7396 }
7397 func rewriteValue386_Op386SUBSS(v *Value) bool {
7398 v_1 := v.Args[1]
7399 v_0 := v.Args[0]
7400
7401
7402
7403 for {
7404 x := v_0
7405 l := v_1
7406 if l.Op != Op386MOVSSload {
7407 break
7408 }
7409 off := auxIntToInt32(l.AuxInt)
7410 sym := auxToSym(l.Aux)
7411 mem := l.Args[1]
7412 ptr := l.Args[0]
7413 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
7414 break
7415 }
7416 v.reset(Op386SUBSSload)
7417 v.AuxInt = int32ToAuxInt(off)
7418 v.Aux = symToAux(sym)
7419 v.AddArg3(x, ptr, mem)
7420 return true
7421 }
7422 return false
7423 }
7424 func rewriteValue386_Op386SUBSSload(v *Value) bool {
7425 v_2 := v.Args[2]
7426 v_1 := v.Args[1]
7427 v_0 := v.Args[0]
7428 b := v.Block
7429 config := b.Func.Config
7430
7431
7432
7433 for {
7434 off1 := auxIntToInt32(v.AuxInt)
7435 sym := auxToSym(v.Aux)
7436 val := v_0
7437 if v_1.Op != Op386ADDLconst {
7438 break
7439 }
7440 off2 := auxIntToInt32(v_1.AuxInt)
7441 base := v_1.Args[0]
7442 mem := v_2
7443 if !(is32Bit(int64(off1) + int64(off2))) {
7444 break
7445 }
7446 v.reset(Op386SUBSSload)
7447 v.AuxInt = int32ToAuxInt(off1 + off2)
7448 v.Aux = symToAux(sym)
7449 v.AddArg3(val, base, mem)
7450 return true
7451 }
7452
7453
7454
7455 for {
7456 off1 := auxIntToInt32(v.AuxInt)
7457 sym1 := auxToSym(v.Aux)
7458 val := v_0
7459 if v_1.Op != Op386LEAL {
7460 break
7461 }
7462 off2 := auxIntToInt32(v_1.AuxInt)
7463 sym2 := auxToSym(v_1.Aux)
7464 base := v_1.Args[0]
7465 mem := v_2
7466 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7467 break
7468 }
7469 v.reset(Op386SUBSSload)
7470 v.AuxInt = int32ToAuxInt(off1 + off2)
7471 v.Aux = symToAux(mergeSym(sym1, sym2))
7472 v.AddArg3(val, base, mem)
7473 return true
7474 }
7475 return false
7476 }
7477 func rewriteValue386_Op386XORL(v *Value) bool {
7478 v_1 := v.Args[1]
7479 v_0 := v.Args[0]
7480
7481
7482 for {
7483 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7484 x := v_0
7485 if v_1.Op != Op386MOVLconst {
7486 continue
7487 }
7488 c := auxIntToInt32(v_1.AuxInt)
7489 v.reset(Op386XORLconst)
7490 v.AuxInt = int32ToAuxInt(c)
7491 v.AddArg(x)
7492 return true
7493 }
7494 break
7495 }
7496
7497
7498
7499 for {
7500 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7501 x := v_0
7502 l := v_1
7503 if l.Op != Op386MOVLload {
7504 continue
7505 }
7506 off := auxIntToInt32(l.AuxInt)
7507 sym := auxToSym(l.Aux)
7508 mem := l.Args[1]
7509 ptr := l.Args[0]
7510 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
7511 continue
7512 }
7513 v.reset(Op386XORLload)
7514 v.AuxInt = int32ToAuxInt(off)
7515 v.Aux = symToAux(sym)
7516 v.AddArg3(x, ptr, mem)
7517 return true
7518 }
7519 break
7520 }
7521
7522
7523 for {
7524 x := v_0
7525 if x != v_1 {
7526 break
7527 }
7528 v.reset(Op386MOVLconst)
7529 v.AuxInt = int32ToAuxInt(0)
7530 return true
7531 }
7532 return false
7533 }
7534 func rewriteValue386_Op386XORLconst(v *Value) bool {
7535 v_0 := v.Args[0]
7536
7537
7538 for {
7539 c := auxIntToInt32(v.AuxInt)
7540 if v_0.Op != Op386XORLconst {
7541 break
7542 }
7543 d := auxIntToInt32(v_0.AuxInt)
7544 x := v_0.Args[0]
7545 v.reset(Op386XORLconst)
7546 v.AuxInt = int32ToAuxInt(c ^ d)
7547 v.AddArg(x)
7548 return true
7549 }
7550
7551
7552
7553 for {
7554 c := auxIntToInt32(v.AuxInt)
7555 x := v_0
7556 if !(c == 0) {
7557 break
7558 }
7559 v.copyOf(x)
7560 return true
7561 }
7562
7563
7564 for {
7565 c := auxIntToInt32(v.AuxInt)
7566 if v_0.Op != Op386MOVLconst {
7567 break
7568 }
7569 d := auxIntToInt32(v_0.AuxInt)
7570 v.reset(Op386MOVLconst)
7571 v.AuxInt = int32ToAuxInt(c ^ d)
7572 return true
7573 }
7574 return false
7575 }
7576 func rewriteValue386_Op386XORLconstmodify(v *Value) bool {
7577 v_1 := v.Args[1]
7578 v_0 := v.Args[0]
7579 b := v.Block
7580 config := b.Func.Config
7581
7582
7583
7584 for {
7585 valoff1 := auxIntToValAndOff(v.AuxInt)
7586 sym := auxToSym(v.Aux)
7587 if v_0.Op != Op386ADDLconst {
7588 break
7589 }
7590 off2 := auxIntToInt32(v_0.AuxInt)
7591 base := v_0.Args[0]
7592 mem := v_1
7593 if !(valoff1.canAdd32(off2)) {
7594 break
7595 }
7596 v.reset(Op386XORLconstmodify)
7597 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
7598 v.Aux = symToAux(sym)
7599 v.AddArg2(base, mem)
7600 return true
7601 }
7602
7603
7604
7605 for {
7606 valoff1 := auxIntToValAndOff(v.AuxInt)
7607 sym1 := auxToSym(v.Aux)
7608 if v_0.Op != Op386LEAL {
7609 break
7610 }
7611 off2 := auxIntToInt32(v_0.AuxInt)
7612 sym2 := auxToSym(v_0.Aux)
7613 base := v_0.Args[0]
7614 mem := v_1
7615 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7616 break
7617 }
7618 v.reset(Op386XORLconstmodify)
7619 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
7620 v.Aux = symToAux(mergeSym(sym1, sym2))
7621 v.AddArg2(base, mem)
7622 return true
7623 }
7624 return false
7625 }
7626 func rewriteValue386_Op386XORLload(v *Value) bool {
7627 v_2 := v.Args[2]
7628 v_1 := v.Args[1]
7629 v_0 := v.Args[0]
7630 b := v.Block
7631 config := b.Func.Config
7632
7633
7634
7635 for {
7636 off1 := auxIntToInt32(v.AuxInt)
7637 sym := auxToSym(v.Aux)
7638 val := v_0
7639 if v_1.Op != Op386ADDLconst {
7640 break
7641 }
7642 off2 := auxIntToInt32(v_1.AuxInt)
7643 base := v_1.Args[0]
7644 mem := v_2
7645 if !(is32Bit(int64(off1) + int64(off2))) {
7646 break
7647 }
7648 v.reset(Op386XORLload)
7649 v.AuxInt = int32ToAuxInt(off1 + off2)
7650 v.Aux = symToAux(sym)
7651 v.AddArg3(val, base, mem)
7652 return true
7653 }
7654
7655
7656
7657 for {
7658 off1 := auxIntToInt32(v.AuxInt)
7659 sym1 := auxToSym(v.Aux)
7660 val := v_0
7661 if v_1.Op != Op386LEAL {
7662 break
7663 }
7664 off2 := auxIntToInt32(v_1.AuxInt)
7665 sym2 := auxToSym(v_1.Aux)
7666 base := v_1.Args[0]
7667 mem := v_2
7668 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7669 break
7670 }
7671 v.reset(Op386XORLload)
7672 v.AuxInt = int32ToAuxInt(off1 + off2)
7673 v.Aux = symToAux(mergeSym(sym1, sym2))
7674 v.AddArg3(val, base, mem)
7675 return true
7676 }
7677 return false
7678 }
7679 func rewriteValue386_Op386XORLmodify(v *Value) bool {
7680 v_2 := v.Args[2]
7681 v_1 := v.Args[1]
7682 v_0 := v.Args[0]
7683 b := v.Block
7684 config := b.Func.Config
7685
7686
7687
7688 for {
7689 off1 := auxIntToInt32(v.AuxInt)
7690 sym := auxToSym(v.Aux)
7691 if v_0.Op != Op386ADDLconst {
7692 break
7693 }
7694 off2 := auxIntToInt32(v_0.AuxInt)
7695 base := v_0.Args[0]
7696 val := v_1
7697 mem := v_2
7698 if !(is32Bit(int64(off1) + int64(off2))) {
7699 break
7700 }
7701 v.reset(Op386XORLmodify)
7702 v.AuxInt = int32ToAuxInt(off1 + off2)
7703 v.Aux = symToAux(sym)
7704 v.AddArg3(base, val, mem)
7705 return true
7706 }
7707
7708
7709
7710 for {
7711 off1 := auxIntToInt32(v.AuxInt)
7712 sym1 := auxToSym(v.Aux)
7713 if v_0.Op != Op386LEAL {
7714 break
7715 }
7716 off2 := auxIntToInt32(v_0.AuxInt)
7717 sym2 := auxToSym(v_0.Aux)
7718 base := v_0.Args[0]
7719 val := v_1
7720 mem := v_2
7721 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
7722 break
7723 }
7724 v.reset(Op386XORLmodify)
7725 v.AuxInt = int32ToAuxInt(off1 + off2)
7726 v.Aux = symToAux(mergeSym(sym1, sym2))
7727 v.AddArg3(base, val, mem)
7728 return true
7729 }
7730 return false
7731 }
7732 func rewriteValue386_OpAddr(v *Value) bool {
7733 v_0 := v.Args[0]
7734
7735
7736 for {
7737 sym := auxToSym(v.Aux)
7738 base := v_0
7739 v.reset(Op386LEAL)
7740 v.Aux = symToAux(sym)
7741 v.AddArg(base)
7742 return true
7743 }
7744 }
7745 func rewriteValue386_OpBswap16(v *Value) bool {
7746 v_0 := v.Args[0]
7747
7748
7749 for {
7750 x := v_0
7751 v.reset(Op386ROLWconst)
7752 v.AuxInt = int16ToAuxInt(8)
7753 v.AddArg(x)
7754 return true
7755 }
7756 }
7757 func rewriteValue386_OpConst16(v *Value) bool {
7758
7759
7760 for {
7761 c := auxIntToInt16(v.AuxInt)
7762 v.reset(Op386MOVLconst)
7763 v.AuxInt = int32ToAuxInt(int32(c))
7764 return true
7765 }
7766 }
7767 func rewriteValue386_OpConst8(v *Value) bool {
7768
7769
7770 for {
7771 c := auxIntToInt8(v.AuxInt)
7772 v.reset(Op386MOVLconst)
7773 v.AuxInt = int32ToAuxInt(int32(c))
7774 return true
7775 }
7776 }
7777 func rewriteValue386_OpConstBool(v *Value) bool {
7778
7779
7780 for {
7781 c := auxIntToBool(v.AuxInt)
7782 v.reset(Op386MOVLconst)
7783 v.AuxInt = int32ToAuxInt(b2i32(c))
7784 return true
7785 }
7786 }
7787 func rewriteValue386_OpConstNil(v *Value) bool {
7788
7789
7790 for {
7791 v.reset(Op386MOVLconst)
7792 v.AuxInt = int32ToAuxInt(0)
7793 return true
7794 }
7795 }
7796 func rewriteValue386_OpCtz16(v *Value) bool {
7797 v_0 := v.Args[0]
7798 b := v.Block
7799 typ := &b.Func.Config.Types
7800
7801
7802 for {
7803 x := v_0
7804 v.reset(Op386BSFL)
7805 v0 := b.NewValue0(v.Pos, Op386ORLconst, typ.UInt32)
7806 v0.AuxInt = int32ToAuxInt(0x10000)
7807 v0.AddArg(x)
7808 v.AddArg(v0)
7809 return true
7810 }
7811 }
7812 func rewriteValue386_OpCtz8(v *Value) bool {
7813 v_0 := v.Args[0]
7814 b := v.Block
7815 typ := &b.Func.Config.Types
7816
7817
7818 for {
7819 x := v_0
7820 v.reset(Op386BSFL)
7821 v0 := b.NewValue0(v.Pos, Op386ORLconst, typ.UInt32)
7822 v0.AuxInt = int32ToAuxInt(0x100)
7823 v0.AddArg(x)
7824 v.AddArg(v0)
7825 return true
7826 }
7827 }
7828 func rewriteValue386_OpDiv8(v *Value) bool {
7829 v_1 := v.Args[1]
7830 v_0 := v.Args[0]
7831 b := v.Block
7832 typ := &b.Func.Config.Types
7833
7834
7835 for {
7836 x := v_0
7837 y := v_1
7838 v.reset(Op386DIVW)
7839 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
7840 v0.AddArg(x)
7841 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
7842 v1.AddArg(y)
7843 v.AddArg2(v0, v1)
7844 return true
7845 }
7846 }
7847 func rewriteValue386_OpDiv8u(v *Value) bool {
7848 v_1 := v.Args[1]
7849 v_0 := v.Args[0]
7850 b := v.Block
7851 typ := &b.Func.Config.Types
7852
7853
7854 for {
7855 x := v_0
7856 y := v_1
7857 v.reset(Op386DIVWU)
7858 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
7859 v0.AddArg(x)
7860 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
7861 v1.AddArg(y)
7862 v.AddArg2(v0, v1)
7863 return true
7864 }
7865 }
7866 func rewriteValue386_OpEq16(v *Value) bool {
7867 v_1 := v.Args[1]
7868 v_0 := v.Args[0]
7869 b := v.Block
7870
7871
7872 for {
7873 x := v_0
7874 y := v_1
7875 v.reset(Op386SETEQ)
7876 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
7877 v0.AddArg2(x, y)
7878 v.AddArg(v0)
7879 return true
7880 }
7881 }
7882 func rewriteValue386_OpEq32(v *Value) bool {
7883 v_1 := v.Args[1]
7884 v_0 := v.Args[0]
7885 b := v.Block
7886
7887
7888 for {
7889 x := v_0
7890 y := v_1
7891 v.reset(Op386SETEQ)
7892 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
7893 v0.AddArg2(x, y)
7894 v.AddArg(v0)
7895 return true
7896 }
7897 }
7898 func rewriteValue386_OpEq32F(v *Value) bool {
7899 v_1 := v.Args[1]
7900 v_0 := v.Args[0]
7901 b := v.Block
7902
7903
7904 for {
7905 x := v_0
7906 y := v_1
7907 v.reset(Op386SETEQF)
7908 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
7909 v0.AddArg2(x, y)
7910 v.AddArg(v0)
7911 return true
7912 }
7913 }
7914 func rewriteValue386_OpEq64F(v *Value) bool {
7915 v_1 := v.Args[1]
7916 v_0 := v.Args[0]
7917 b := v.Block
7918
7919
7920 for {
7921 x := v_0
7922 y := v_1
7923 v.reset(Op386SETEQF)
7924 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
7925 v0.AddArg2(x, y)
7926 v.AddArg(v0)
7927 return true
7928 }
7929 }
7930 func rewriteValue386_OpEq8(v *Value) bool {
7931 v_1 := v.Args[1]
7932 v_0 := v.Args[0]
7933 b := v.Block
7934
7935
7936 for {
7937 x := v_0
7938 y := v_1
7939 v.reset(Op386SETEQ)
7940 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
7941 v0.AddArg2(x, y)
7942 v.AddArg(v0)
7943 return true
7944 }
7945 }
7946 func rewriteValue386_OpEqB(v *Value) bool {
7947 v_1 := v.Args[1]
7948 v_0 := v.Args[0]
7949 b := v.Block
7950
7951
7952 for {
7953 x := v_0
7954 y := v_1
7955 v.reset(Op386SETEQ)
7956 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
7957 v0.AddArg2(x, y)
7958 v.AddArg(v0)
7959 return true
7960 }
7961 }
7962 func rewriteValue386_OpEqPtr(v *Value) bool {
7963 v_1 := v.Args[1]
7964 v_0 := v.Args[0]
7965 b := v.Block
7966
7967
7968 for {
7969 x := v_0
7970 y := v_1
7971 v.reset(Op386SETEQ)
7972 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
7973 v0.AddArg2(x, y)
7974 v.AddArg(v0)
7975 return true
7976 }
7977 }
7978 func rewriteValue386_OpIsInBounds(v *Value) bool {
7979 v_1 := v.Args[1]
7980 v_0 := v.Args[0]
7981 b := v.Block
7982
7983
7984 for {
7985 idx := v_0
7986 len := v_1
7987 v.reset(Op386SETB)
7988 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
7989 v0.AddArg2(idx, len)
7990 v.AddArg(v0)
7991 return true
7992 }
7993 }
7994 func rewriteValue386_OpIsNonNil(v *Value) bool {
7995 v_0 := v.Args[0]
7996 b := v.Block
7997
7998
7999 for {
8000 p := v_0
8001 v.reset(Op386SETNE)
8002 v0 := b.NewValue0(v.Pos, Op386TESTL, types.TypeFlags)
8003 v0.AddArg2(p, p)
8004 v.AddArg(v0)
8005 return true
8006 }
8007 }
8008 func rewriteValue386_OpIsSliceInBounds(v *Value) bool {
8009 v_1 := v.Args[1]
8010 v_0 := v.Args[0]
8011 b := v.Block
8012
8013
8014 for {
8015 idx := v_0
8016 len := v_1
8017 v.reset(Op386SETBE)
8018 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8019 v0.AddArg2(idx, len)
8020 v.AddArg(v0)
8021 return true
8022 }
8023 }
8024 func rewriteValue386_OpLeq16(v *Value) bool {
8025 v_1 := v.Args[1]
8026 v_0 := v.Args[0]
8027 b := v.Block
8028
8029
8030 for {
8031 x := v_0
8032 y := v_1
8033 v.reset(Op386SETLE)
8034 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8035 v0.AddArg2(x, y)
8036 v.AddArg(v0)
8037 return true
8038 }
8039 }
8040 func rewriteValue386_OpLeq16U(v *Value) bool {
8041 v_1 := v.Args[1]
8042 v_0 := v.Args[0]
8043 b := v.Block
8044
8045
8046 for {
8047 x := v_0
8048 y := v_1
8049 v.reset(Op386SETBE)
8050 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8051 v0.AddArg2(x, y)
8052 v.AddArg(v0)
8053 return true
8054 }
8055 }
8056 func rewriteValue386_OpLeq32(v *Value) bool {
8057 v_1 := v.Args[1]
8058 v_0 := v.Args[0]
8059 b := v.Block
8060
8061
8062 for {
8063 x := v_0
8064 y := v_1
8065 v.reset(Op386SETLE)
8066 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8067 v0.AddArg2(x, y)
8068 v.AddArg(v0)
8069 return true
8070 }
8071 }
8072 func rewriteValue386_OpLeq32F(v *Value) bool {
8073 v_1 := v.Args[1]
8074 v_0 := v.Args[0]
8075 b := v.Block
8076
8077
8078 for {
8079 x := v_0
8080 y := v_1
8081 v.reset(Op386SETGEF)
8082 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8083 v0.AddArg2(y, x)
8084 v.AddArg(v0)
8085 return true
8086 }
8087 }
8088 func rewriteValue386_OpLeq32U(v *Value) bool {
8089 v_1 := v.Args[1]
8090 v_0 := v.Args[0]
8091 b := v.Block
8092
8093
8094 for {
8095 x := v_0
8096 y := v_1
8097 v.reset(Op386SETBE)
8098 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8099 v0.AddArg2(x, y)
8100 v.AddArg(v0)
8101 return true
8102 }
8103 }
8104 func rewriteValue386_OpLeq64F(v *Value) bool {
8105 v_1 := v.Args[1]
8106 v_0 := v.Args[0]
8107 b := v.Block
8108
8109
8110 for {
8111 x := v_0
8112 y := v_1
8113 v.reset(Op386SETGEF)
8114 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
8115 v0.AddArg2(y, x)
8116 v.AddArg(v0)
8117 return true
8118 }
8119 }
8120 func rewriteValue386_OpLeq8(v *Value) bool {
8121 v_1 := v.Args[1]
8122 v_0 := v.Args[0]
8123 b := v.Block
8124
8125
8126 for {
8127 x := v_0
8128 y := v_1
8129 v.reset(Op386SETLE)
8130 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8131 v0.AddArg2(x, y)
8132 v.AddArg(v0)
8133 return true
8134 }
8135 }
8136 func rewriteValue386_OpLeq8U(v *Value) bool {
8137 v_1 := v.Args[1]
8138 v_0 := v.Args[0]
8139 b := v.Block
8140
8141
8142 for {
8143 x := v_0
8144 y := v_1
8145 v.reset(Op386SETBE)
8146 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8147 v0.AddArg2(x, y)
8148 v.AddArg(v0)
8149 return true
8150 }
8151 }
8152 func rewriteValue386_OpLess16(v *Value) bool {
8153 v_1 := v.Args[1]
8154 v_0 := v.Args[0]
8155 b := v.Block
8156
8157
8158 for {
8159 x := v_0
8160 y := v_1
8161 v.reset(Op386SETL)
8162 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8163 v0.AddArg2(x, y)
8164 v.AddArg(v0)
8165 return true
8166 }
8167 }
8168 func rewriteValue386_OpLess16U(v *Value) bool {
8169 v_1 := v.Args[1]
8170 v_0 := v.Args[0]
8171 b := v.Block
8172
8173
8174 for {
8175 x := v_0
8176 y := v_1
8177 v.reset(Op386SETB)
8178 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8179 v0.AddArg2(x, y)
8180 v.AddArg(v0)
8181 return true
8182 }
8183 }
8184 func rewriteValue386_OpLess32(v *Value) bool {
8185 v_1 := v.Args[1]
8186 v_0 := v.Args[0]
8187 b := v.Block
8188
8189
8190 for {
8191 x := v_0
8192 y := v_1
8193 v.reset(Op386SETL)
8194 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8195 v0.AddArg2(x, y)
8196 v.AddArg(v0)
8197 return true
8198 }
8199 }
8200 func rewriteValue386_OpLess32F(v *Value) bool {
8201 v_1 := v.Args[1]
8202 v_0 := v.Args[0]
8203 b := v.Block
8204
8205
8206 for {
8207 x := v_0
8208 y := v_1
8209 v.reset(Op386SETGF)
8210 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8211 v0.AddArg2(y, x)
8212 v.AddArg(v0)
8213 return true
8214 }
8215 }
8216 func rewriteValue386_OpLess32U(v *Value) bool {
8217 v_1 := v.Args[1]
8218 v_0 := v.Args[0]
8219 b := v.Block
8220
8221
8222 for {
8223 x := v_0
8224 y := v_1
8225 v.reset(Op386SETB)
8226 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8227 v0.AddArg2(x, y)
8228 v.AddArg(v0)
8229 return true
8230 }
8231 }
8232 func rewriteValue386_OpLess64F(v *Value) bool {
8233 v_1 := v.Args[1]
8234 v_0 := v.Args[0]
8235 b := v.Block
8236
8237
8238 for {
8239 x := v_0
8240 y := v_1
8241 v.reset(Op386SETGF)
8242 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
8243 v0.AddArg2(y, x)
8244 v.AddArg(v0)
8245 return true
8246 }
8247 }
8248 func rewriteValue386_OpLess8(v *Value) bool {
8249 v_1 := v.Args[1]
8250 v_0 := v.Args[0]
8251 b := v.Block
8252
8253
8254 for {
8255 x := v_0
8256 y := v_1
8257 v.reset(Op386SETL)
8258 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8259 v0.AddArg2(x, y)
8260 v.AddArg(v0)
8261 return true
8262 }
8263 }
8264 func rewriteValue386_OpLess8U(v *Value) bool {
8265 v_1 := v.Args[1]
8266 v_0 := v.Args[0]
8267 b := v.Block
8268
8269
8270 for {
8271 x := v_0
8272 y := v_1
8273 v.reset(Op386SETB)
8274 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8275 v0.AddArg2(x, y)
8276 v.AddArg(v0)
8277 return true
8278 }
8279 }
8280 func rewriteValue386_OpLoad(v *Value) bool {
8281 v_1 := v.Args[1]
8282 v_0 := v.Args[0]
8283
8284
8285
8286 for {
8287 t := v.Type
8288 ptr := v_0
8289 mem := v_1
8290 if !(is32BitInt(t) || isPtr(t)) {
8291 break
8292 }
8293 v.reset(Op386MOVLload)
8294 v.AddArg2(ptr, mem)
8295 return true
8296 }
8297
8298
8299
8300 for {
8301 t := v.Type
8302 ptr := v_0
8303 mem := v_1
8304 if !(is16BitInt(t)) {
8305 break
8306 }
8307 v.reset(Op386MOVWload)
8308 v.AddArg2(ptr, mem)
8309 return true
8310 }
8311
8312
8313
8314 for {
8315 t := v.Type
8316 ptr := v_0
8317 mem := v_1
8318 if !(t.IsBoolean() || is8BitInt(t)) {
8319 break
8320 }
8321 v.reset(Op386MOVBload)
8322 v.AddArg2(ptr, mem)
8323 return true
8324 }
8325
8326
8327
8328 for {
8329 t := v.Type
8330 ptr := v_0
8331 mem := v_1
8332 if !(is32BitFloat(t)) {
8333 break
8334 }
8335 v.reset(Op386MOVSSload)
8336 v.AddArg2(ptr, mem)
8337 return true
8338 }
8339
8340
8341
8342 for {
8343 t := v.Type
8344 ptr := v_0
8345 mem := v_1
8346 if !(is64BitFloat(t)) {
8347 break
8348 }
8349 v.reset(Op386MOVSDload)
8350 v.AddArg2(ptr, mem)
8351 return true
8352 }
8353 return false
8354 }
8355 func rewriteValue386_OpLocalAddr(v *Value) bool {
8356 v_1 := v.Args[1]
8357 v_0 := v.Args[0]
8358 b := v.Block
8359 typ := &b.Func.Config.Types
8360
8361
8362
8363 for {
8364 t := v.Type
8365 sym := auxToSym(v.Aux)
8366 base := v_0
8367 mem := v_1
8368 if !(t.Elem().HasPointers()) {
8369 break
8370 }
8371 v.reset(Op386LEAL)
8372 v.Aux = symToAux(sym)
8373 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
8374 v0.AddArg2(base, mem)
8375 v.AddArg(v0)
8376 return true
8377 }
8378
8379
8380
8381 for {
8382 t := v.Type
8383 sym := auxToSym(v.Aux)
8384 base := v_0
8385 if !(!t.Elem().HasPointers()) {
8386 break
8387 }
8388 v.reset(Op386LEAL)
8389 v.Aux = symToAux(sym)
8390 v.AddArg(base)
8391 return true
8392 }
8393 return false
8394 }
8395 func rewriteValue386_OpLsh16x16(v *Value) bool {
8396 v_1 := v.Args[1]
8397 v_0 := v.Args[0]
8398 b := v.Block
8399
8400
8401
8402 for {
8403 t := v.Type
8404 x := v_0
8405 y := v_1
8406 if !(!shiftIsBounded(v)) {
8407 break
8408 }
8409 v.reset(Op386ANDL)
8410 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8411 v0.AddArg2(x, y)
8412 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8413 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
8414 v2.AuxInt = int16ToAuxInt(32)
8415 v2.AddArg(y)
8416 v1.AddArg(v2)
8417 v.AddArg2(v0, v1)
8418 return true
8419 }
8420
8421
8422
8423 for {
8424 t := v.Type
8425 x := v_0
8426 y := v_1
8427 if !(shiftIsBounded(v)) {
8428 break
8429 }
8430 v.reset(Op386SHLL)
8431 v.Type = t
8432 v.AddArg2(x, y)
8433 return true
8434 }
8435 return false
8436 }
8437 func rewriteValue386_OpLsh16x32(v *Value) bool {
8438 v_1 := v.Args[1]
8439 v_0 := v.Args[0]
8440 b := v.Block
8441
8442
8443
8444 for {
8445 t := v.Type
8446 x := v_0
8447 y := v_1
8448 if !(!shiftIsBounded(v)) {
8449 break
8450 }
8451 v.reset(Op386ANDL)
8452 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8453 v0.AddArg2(x, y)
8454 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8455 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
8456 v2.AuxInt = int32ToAuxInt(32)
8457 v2.AddArg(y)
8458 v1.AddArg(v2)
8459 v.AddArg2(v0, v1)
8460 return true
8461 }
8462
8463
8464
8465 for {
8466 t := v.Type
8467 x := v_0
8468 y := v_1
8469 if !(shiftIsBounded(v)) {
8470 break
8471 }
8472 v.reset(Op386SHLL)
8473 v.Type = t
8474 v.AddArg2(x, y)
8475 return true
8476 }
8477 return false
8478 }
8479 func rewriteValue386_OpLsh16x64(v *Value) bool {
8480 v_1 := v.Args[1]
8481 v_0 := v.Args[0]
8482
8483
8484
8485 for {
8486 x := v_0
8487 if v_1.Op != OpConst64 {
8488 break
8489 }
8490 c := auxIntToInt64(v_1.AuxInt)
8491 if !(uint64(c) < 16) {
8492 break
8493 }
8494 v.reset(Op386SHLLconst)
8495 v.AuxInt = int32ToAuxInt(int32(c))
8496 v.AddArg(x)
8497 return true
8498 }
8499
8500
8501
8502 for {
8503 if v_1.Op != OpConst64 {
8504 break
8505 }
8506 c := auxIntToInt64(v_1.AuxInt)
8507 if !(uint64(c) >= 16) {
8508 break
8509 }
8510 v.reset(OpConst16)
8511 v.AuxInt = int16ToAuxInt(0)
8512 return true
8513 }
8514 return false
8515 }
8516 func rewriteValue386_OpLsh16x8(v *Value) bool {
8517 v_1 := v.Args[1]
8518 v_0 := v.Args[0]
8519 b := v.Block
8520
8521
8522
8523 for {
8524 t := v.Type
8525 x := v_0
8526 y := v_1
8527 if !(!shiftIsBounded(v)) {
8528 break
8529 }
8530 v.reset(Op386ANDL)
8531 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8532 v0.AddArg2(x, y)
8533 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8534 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
8535 v2.AuxInt = int8ToAuxInt(32)
8536 v2.AddArg(y)
8537 v1.AddArg(v2)
8538 v.AddArg2(v0, v1)
8539 return true
8540 }
8541
8542
8543
8544 for {
8545 t := v.Type
8546 x := v_0
8547 y := v_1
8548 if !(shiftIsBounded(v)) {
8549 break
8550 }
8551 v.reset(Op386SHLL)
8552 v.Type = t
8553 v.AddArg2(x, y)
8554 return true
8555 }
8556 return false
8557 }
8558 func rewriteValue386_OpLsh32x16(v *Value) bool {
8559 v_1 := v.Args[1]
8560 v_0 := v.Args[0]
8561 b := v.Block
8562
8563
8564
8565 for {
8566 t := v.Type
8567 x := v_0
8568 y := v_1
8569 if !(!shiftIsBounded(v)) {
8570 break
8571 }
8572 v.reset(Op386ANDL)
8573 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8574 v0.AddArg2(x, y)
8575 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8576 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
8577 v2.AuxInt = int16ToAuxInt(32)
8578 v2.AddArg(y)
8579 v1.AddArg(v2)
8580 v.AddArg2(v0, v1)
8581 return true
8582 }
8583
8584
8585
8586 for {
8587 t := v.Type
8588 x := v_0
8589 y := v_1
8590 if !(shiftIsBounded(v)) {
8591 break
8592 }
8593 v.reset(Op386SHLL)
8594 v.Type = t
8595 v.AddArg2(x, y)
8596 return true
8597 }
8598 return false
8599 }
8600 func rewriteValue386_OpLsh32x32(v *Value) bool {
8601 v_1 := v.Args[1]
8602 v_0 := v.Args[0]
8603 b := v.Block
8604
8605
8606
8607 for {
8608 t := v.Type
8609 x := v_0
8610 y := v_1
8611 if !(!shiftIsBounded(v)) {
8612 break
8613 }
8614 v.reset(Op386ANDL)
8615 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8616 v0.AddArg2(x, y)
8617 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8618 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
8619 v2.AuxInt = int32ToAuxInt(32)
8620 v2.AddArg(y)
8621 v1.AddArg(v2)
8622 v.AddArg2(v0, v1)
8623 return true
8624 }
8625
8626
8627
8628 for {
8629 t := v.Type
8630 x := v_0
8631 y := v_1
8632 if !(shiftIsBounded(v)) {
8633 break
8634 }
8635 v.reset(Op386SHLL)
8636 v.Type = t
8637 v.AddArg2(x, y)
8638 return true
8639 }
8640 return false
8641 }
8642 func rewriteValue386_OpLsh32x64(v *Value) bool {
8643 v_1 := v.Args[1]
8644 v_0 := v.Args[0]
8645
8646
8647
8648 for {
8649 x := v_0
8650 if v_1.Op != OpConst64 {
8651 break
8652 }
8653 c := auxIntToInt64(v_1.AuxInt)
8654 if !(uint64(c) < 32) {
8655 break
8656 }
8657 v.reset(Op386SHLLconst)
8658 v.AuxInt = int32ToAuxInt(int32(c))
8659 v.AddArg(x)
8660 return true
8661 }
8662
8663
8664
8665 for {
8666 if v_1.Op != OpConst64 {
8667 break
8668 }
8669 c := auxIntToInt64(v_1.AuxInt)
8670 if !(uint64(c) >= 32) {
8671 break
8672 }
8673 v.reset(OpConst32)
8674 v.AuxInt = int32ToAuxInt(0)
8675 return true
8676 }
8677 return false
8678 }
8679 func rewriteValue386_OpLsh32x8(v *Value) bool {
8680 v_1 := v.Args[1]
8681 v_0 := v.Args[0]
8682 b := v.Block
8683
8684
8685
8686 for {
8687 t := v.Type
8688 x := v_0
8689 y := v_1
8690 if !(!shiftIsBounded(v)) {
8691 break
8692 }
8693 v.reset(Op386ANDL)
8694 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8695 v0.AddArg2(x, y)
8696 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8697 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
8698 v2.AuxInt = int8ToAuxInt(32)
8699 v2.AddArg(y)
8700 v1.AddArg(v2)
8701 v.AddArg2(v0, v1)
8702 return true
8703 }
8704
8705
8706
8707 for {
8708 t := v.Type
8709 x := v_0
8710 y := v_1
8711 if !(shiftIsBounded(v)) {
8712 break
8713 }
8714 v.reset(Op386SHLL)
8715 v.Type = t
8716 v.AddArg2(x, y)
8717 return true
8718 }
8719 return false
8720 }
8721 func rewriteValue386_OpLsh8x16(v *Value) bool {
8722 v_1 := v.Args[1]
8723 v_0 := v.Args[0]
8724 b := v.Block
8725
8726
8727
8728 for {
8729 t := v.Type
8730 x := v_0
8731 y := v_1
8732 if !(!shiftIsBounded(v)) {
8733 break
8734 }
8735 v.reset(Op386ANDL)
8736 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8737 v0.AddArg2(x, y)
8738 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8739 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
8740 v2.AuxInt = int16ToAuxInt(32)
8741 v2.AddArg(y)
8742 v1.AddArg(v2)
8743 v.AddArg2(v0, v1)
8744 return true
8745 }
8746
8747
8748
8749 for {
8750 t := v.Type
8751 x := v_0
8752 y := v_1
8753 if !(shiftIsBounded(v)) {
8754 break
8755 }
8756 v.reset(Op386SHLL)
8757 v.Type = t
8758 v.AddArg2(x, y)
8759 return true
8760 }
8761 return false
8762 }
8763 func rewriteValue386_OpLsh8x32(v *Value) bool {
8764 v_1 := v.Args[1]
8765 v_0 := v.Args[0]
8766 b := v.Block
8767
8768
8769
8770 for {
8771 t := v.Type
8772 x := v_0
8773 y := v_1
8774 if !(!shiftIsBounded(v)) {
8775 break
8776 }
8777 v.reset(Op386ANDL)
8778 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8779 v0.AddArg2(x, y)
8780 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8781 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
8782 v2.AuxInt = int32ToAuxInt(32)
8783 v2.AddArg(y)
8784 v1.AddArg(v2)
8785 v.AddArg2(v0, v1)
8786 return true
8787 }
8788
8789
8790
8791 for {
8792 t := v.Type
8793 x := v_0
8794 y := v_1
8795 if !(shiftIsBounded(v)) {
8796 break
8797 }
8798 v.reset(Op386SHLL)
8799 v.Type = t
8800 v.AddArg2(x, y)
8801 return true
8802 }
8803 return false
8804 }
8805 func rewriteValue386_OpLsh8x64(v *Value) bool {
8806 v_1 := v.Args[1]
8807 v_0 := v.Args[0]
8808
8809
8810
8811 for {
8812 x := v_0
8813 if v_1.Op != OpConst64 {
8814 break
8815 }
8816 c := auxIntToInt64(v_1.AuxInt)
8817 if !(uint64(c) < 8) {
8818 break
8819 }
8820 v.reset(Op386SHLLconst)
8821 v.AuxInt = int32ToAuxInt(int32(c))
8822 v.AddArg(x)
8823 return true
8824 }
8825
8826
8827
8828 for {
8829 if v_1.Op != OpConst64 {
8830 break
8831 }
8832 c := auxIntToInt64(v_1.AuxInt)
8833 if !(uint64(c) >= 8) {
8834 break
8835 }
8836 v.reset(OpConst8)
8837 v.AuxInt = int8ToAuxInt(0)
8838 return true
8839 }
8840 return false
8841 }
8842 func rewriteValue386_OpLsh8x8(v *Value) bool {
8843 v_1 := v.Args[1]
8844 v_0 := v.Args[0]
8845 b := v.Block
8846
8847
8848
8849 for {
8850 t := v.Type
8851 x := v_0
8852 y := v_1
8853 if !(!shiftIsBounded(v)) {
8854 break
8855 }
8856 v.reset(Op386ANDL)
8857 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
8858 v0.AddArg2(x, y)
8859 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
8860 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
8861 v2.AuxInt = int8ToAuxInt(32)
8862 v2.AddArg(y)
8863 v1.AddArg(v2)
8864 v.AddArg2(v0, v1)
8865 return true
8866 }
8867
8868
8869
8870 for {
8871 t := v.Type
8872 x := v_0
8873 y := v_1
8874 if !(shiftIsBounded(v)) {
8875 break
8876 }
8877 v.reset(Op386SHLL)
8878 v.Type = t
8879 v.AddArg2(x, y)
8880 return true
8881 }
8882 return false
8883 }
8884 func rewriteValue386_OpMod8(v *Value) bool {
8885 v_1 := v.Args[1]
8886 v_0 := v.Args[0]
8887 b := v.Block
8888 typ := &b.Func.Config.Types
8889
8890
8891 for {
8892 x := v_0
8893 y := v_1
8894 v.reset(Op386MODW)
8895 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8896 v0.AddArg(x)
8897 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8898 v1.AddArg(y)
8899 v.AddArg2(v0, v1)
8900 return true
8901 }
8902 }
8903 func rewriteValue386_OpMod8u(v *Value) bool {
8904 v_1 := v.Args[1]
8905 v_0 := v.Args[0]
8906 b := v.Block
8907 typ := &b.Func.Config.Types
8908
8909
8910 for {
8911 x := v_0
8912 y := v_1
8913 v.reset(Op386MODWU)
8914 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8915 v0.AddArg(x)
8916 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8917 v1.AddArg(y)
8918 v.AddArg2(v0, v1)
8919 return true
8920 }
8921 }
8922 func rewriteValue386_OpMove(v *Value) bool {
8923 v_2 := v.Args[2]
8924 v_1 := v.Args[1]
8925 v_0 := v.Args[0]
8926 b := v.Block
8927 typ := &b.Func.Config.Types
8928
8929
8930 for {
8931 if auxIntToInt64(v.AuxInt) != 0 {
8932 break
8933 }
8934 mem := v_2
8935 v.copyOf(mem)
8936 return true
8937 }
8938
8939
8940 for {
8941 if auxIntToInt64(v.AuxInt) != 1 {
8942 break
8943 }
8944 dst := v_0
8945 src := v_1
8946 mem := v_2
8947 v.reset(Op386MOVBstore)
8948 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
8949 v0.AddArg2(src, mem)
8950 v.AddArg3(dst, v0, mem)
8951 return true
8952 }
8953
8954
8955 for {
8956 if auxIntToInt64(v.AuxInt) != 2 {
8957 break
8958 }
8959 dst := v_0
8960 src := v_1
8961 mem := v_2
8962 v.reset(Op386MOVWstore)
8963 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
8964 v0.AddArg2(src, mem)
8965 v.AddArg3(dst, v0, mem)
8966 return true
8967 }
8968
8969
8970 for {
8971 if auxIntToInt64(v.AuxInt) != 4 {
8972 break
8973 }
8974 dst := v_0
8975 src := v_1
8976 mem := v_2
8977 v.reset(Op386MOVLstore)
8978 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
8979 v0.AddArg2(src, mem)
8980 v.AddArg3(dst, v0, mem)
8981 return true
8982 }
8983
8984
8985 for {
8986 if auxIntToInt64(v.AuxInt) != 3 {
8987 break
8988 }
8989 dst := v_0
8990 src := v_1
8991 mem := v_2
8992 v.reset(Op386MOVBstore)
8993 v.AuxInt = int32ToAuxInt(2)
8994 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
8995 v0.AuxInt = int32ToAuxInt(2)
8996 v0.AddArg2(src, mem)
8997 v1 := b.NewValue0(v.Pos, Op386MOVWstore, types.TypeMem)
8998 v2 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
8999 v2.AddArg2(src, mem)
9000 v1.AddArg3(dst, v2, mem)
9001 v.AddArg3(dst, v0, v1)
9002 return true
9003 }
9004
9005
9006 for {
9007 if auxIntToInt64(v.AuxInt) != 5 {
9008 break
9009 }
9010 dst := v_0
9011 src := v_1
9012 mem := v_2
9013 v.reset(Op386MOVBstore)
9014 v.AuxInt = int32ToAuxInt(4)
9015 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9016 v0.AuxInt = int32ToAuxInt(4)
9017 v0.AddArg2(src, mem)
9018 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9019 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9020 v2.AddArg2(src, mem)
9021 v1.AddArg3(dst, v2, mem)
9022 v.AddArg3(dst, v0, v1)
9023 return true
9024 }
9025
9026
9027 for {
9028 if auxIntToInt64(v.AuxInt) != 6 {
9029 break
9030 }
9031 dst := v_0
9032 src := v_1
9033 mem := v_2
9034 v.reset(Op386MOVWstore)
9035 v.AuxInt = int32ToAuxInt(4)
9036 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9037 v0.AuxInt = int32ToAuxInt(4)
9038 v0.AddArg2(src, mem)
9039 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9040 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9041 v2.AddArg2(src, mem)
9042 v1.AddArg3(dst, v2, mem)
9043 v.AddArg3(dst, v0, v1)
9044 return true
9045 }
9046
9047
9048 for {
9049 if auxIntToInt64(v.AuxInt) != 7 {
9050 break
9051 }
9052 dst := v_0
9053 src := v_1
9054 mem := v_2
9055 v.reset(Op386MOVLstore)
9056 v.AuxInt = int32ToAuxInt(3)
9057 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9058 v0.AuxInt = int32ToAuxInt(3)
9059 v0.AddArg2(src, mem)
9060 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9061 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9062 v2.AddArg2(src, mem)
9063 v1.AddArg3(dst, v2, mem)
9064 v.AddArg3(dst, v0, v1)
9065 return true
9066 }
9067
9068
9069 for {
9070 if auxIntToInt64(v.AuxInt) != 8 {
9071 break
9072 }
9073 dst := v_0
9074 src := v_1
9075 mem := v_2
9076 v.reset(Op386MOVLstore)
9077 v.AuxInt = int32ToAuxInt(4)
9078 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9079 v0.AuxInt = int32ToAuxInt(4)
9080 v0.AddArg2(src, mem)
9081 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9082 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9083 v2.AddArg2(src, mem)
9084 v1.AddArg3(dst, v2, mem)
9085 v.AddArg3(dst, v0, v1)
9086 return true
9087 }
9088
9089
9090
9091 for {
9092 s := auxIntToInt64(v.AuxInt)
9093 dst := v_0
9094 src := v_1
9095 mem := v_2
9096 if !(s > 8 && s%4 != 0) {
9097 break
9098 }
9099 v.reset(OpMove)
9100 v.AuxInt = int64ToAuxInt(s - s%4)
9101 v0 := b.NewValue0(v.Pos, Op386ADDLconst, dst.Type)
9102 v0.AuxInt = int32ToAuxInt(int32(s % 4))
9103 v0.AddArg(dst)
9104 v1 := b.NewValue0(v.Pos, Op386ADDLconst, src.Type)
9105 v1.AuxInt = int32ToAuxInt(int32(s % 4))
9106 v1.AddArg(src)
9107 v2 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9108 v3 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9109 v3.AddArg2(src, mem)
9110 v2.AddArg3(dst, v3, mem)
9111 v.AddArg3(v0, v1, v2)
9112 return true
9113 }
9114
9115
9116
9117 for {
9118 s := auxIntToInt64(v.AuxInt)
9119 dst := v_0
9120 src := v_1
9121 mem := v_2
9122 if !(s > 8 && s <= 4*128 && s%4 == 0 && logLargeCopy(v, s)) {
9123 break
9124 }
9125 v.reset(Op386DUFFCOPY)
9126 v.AuxInt = int64ToAuxInt(10 * (128 - s/4))
9127 v.AddArg3(dst, src, mem)
9128 return true
9129 }
9130
9131
9132
9133 for {
9134 s := auxIntToInt64(v.AuxInt)
9135 dst := v_0
9136 src := v_1
9137 mem := v_2
9138 if !(s > 4*128 && s%4 == 0 && logLargeCopy(v, s)) {
9139 break
9140 }
9141 v.reset(Op386REPMOVSL)
9142 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
9143 v0.AuxInt = int32ToAuxInt(int32(s / 4))
9144 v.AddArg4(dst, src, v0, mem)
9145 return true
9146 }
9147 return false
9148 }
9149 func rewriteValue386_OpNeg32F(v *Value) bool {
9150 v_0 := v.Args[0]
9151 b := v.Block
9152 typ := &b.Func.Config.Types
9153
9154
9155 for {
9156 x := v_0
9157 v.reset(Op386PXOR)
9158 v0 := b.NewValue0(v.Pos, Op386MOVSSconst, typ.Float32)
9159 v0.AuxInt = float32ToAuxInt(float32(math.Copysign(0, -1)))
9160 v.AddArg2(x, v0)
9161 return true
9162 }
9163 }
9164 func rewriteValue386_OpNeg64F(v *Value) bool {
9165 v_0 := v.Args[0]
9166 b := v.Block
9167 typ := &b.Func.Config.Types
9168
9169
9170 for {
9171 x := v_0
9172 v.reset(Op386PXOR)
9173 v0 := b.NewValue0(v.Pos, Op386MOVSDconst, typ.Float64)
9174 v0.AuxInt = float64ToAuxInt(math.Copysign(0, -1))
9175 v.AddArg2(x, v0)
9176 return true
9177 }
9178 }
9179 func rewriteValue386_OpNeq16(v *Value) bool {
9180 v_1 := v.Args[1]
9181 v_0 := v.Args[0]
9182 b := v.Block
9183
9184
9185 for {
9186 x := v_0
9187 y := v_1
9188 v.reset(Op386SETNE)
9189 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
9190 v0.AddArg2(x, y)
9191 v.AddArg(v0)
9192 return true
9193 }
9194 }
9195 func rewriteValue386_OpNeq32(v *Value) bool {
9196 v_1 := v.Args[1]
9197 v_0 := v.Args[0]
9198 b := v.Block
9199
9200
9201 for {
9202 x := v_0
9203 y := v_1
9204 v.reset(Op386SETNE)
9205 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9206 v0.AddArg2(x, y)
9207 v.AddArg(v0)
9208 return true
9209 }
9210 }
9211 func rewriteValue386_OpNeq32F(v *Value) bool {
9212 v_1 := v.Args[1]
9213 v_0 := v.Args[0]
9214 b := v.Block
9215
9216
9217 for {
9218 x := v_0
9219 y := v_1
9220 v.reset(Op386SETNEF)
9221 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
9222 v0.AddArg2(x, y)
9223 v.AddArg(v0)
9224 return true
9225 }
9226 }
9227 func rewriteValue386_OpNeq64F(v *Value) bool {
9228 v_1 := v.Args[1]
9229 v_0 := v.Args[0]
9230 b := v.Block
9231
9232
9233 for {
9234 x := v_0
9235 y := v_1
9236 v.reset(Op386SETNEF)
9237 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
9238 v0.AddArg2(x, y)
9239 v.AddArg(v0)
9240 return true
9241 }
9242 }
9243 func rewriteValue386_OpNeq8(v *Value) bool {
9244 v_1 := v.Args[1]
9245 v_0 := v.Args[0]
9246 b := v.Block
9247
9248
9249 for {
9250 x := v_0
9251 y := v_1
9252 v.reset(Op386SETNE)
9253 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9254 v0.AddArg2(x, y)
9255 v.AddArg(v0)
9256 return true
9257 }
9258 }
9259 func rewriteValue386_OpNeqB(v *Value) bool {
9260 v_1 := v.Args[1]
9261 v_0 := v.Args[0]
9262 b := v.Block
9263
9264
9265 for {
9266 x := v_0
9267 y := v_1
9268 v.reset(Op386SETNE)
9269 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9270 v0.AddArg2(x, y)
9271 v.AddArg(v0)
9272 return true
9273 }
9274 }
9275 func rewriteValue386_OpNeqPtr(v *Value) bool {
9276 v_1 := v.Args[1]
9277 v_0 := v.Args[0]
9278 b := v.Block
9279
9280
9281 for {
9282 x := v_0
9283 y := v_1
9284 v.reset(Op386SETNE)
9285 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9286 v0.AddArg2(x, y)
9287 v.AddArg(v0)
9288 return true
9289 }
9290 }
9291 func rewriteValue386_OpNot(v *Value) bool {
9292 v_0 := v.Args[0]
9293
9294
9295 for {
9296 x := v_0
9297 v.reset(Op386XORLconst)
9298 v.AuxInt = int32ToAuxInt(1)
9299 v.AddArg(x)
9300 return true
9301 }
9302 }
9303 func rewriteValue386_OpOffPtr(v *Value) bool {
9304 v_0 := v.Args[0]
9305
9306
9307 for {
9308 off := auxIntToInt64(v.AuxInt)
9309 ptr := v_0
9310 v.reset(Op386ADDLconst)
9311 v.AuxInt = int32ToAuxInt(int32(off))
9312 v.AddArg(ptr)
9313 return true
9314 }
9315 }
9316 func rewriteValue386_OpPanicBounds(v *Value) bool {
9317 v_2 := v.Args[2]
9318 v_1 := v.Args[1]
9319 v_0 := v.Args[0]
9320
9321
9322
9323 for {
9324 kind := auxIntToInt64(v.AuxInt)
9325 x := v_0
9326 y := v_1
9327 mem := v_2
9328 if !(boundsABI(kind) == 0) {
9329 break
9330 }
9331 v.reset(Op386LoweredPanicBoundsA)
9332 v.AuxInt = int64ToAuxInt(kind)
9333 v.AddArg3(x, y, mem)
9334 return true
9335 }
9336
9337
9338
9339 for {
9340 kind := auxIntToInt64(v.AuxInt)
9341 x := v_0
9342 y := v_1
9343 mem := v_2
9344 if !(boundsABI(kind) == 1) {
9345 break
9346 }
9347 v.reset(Op386LoweredPanicBoundsB)
9348 v.AuxInt = int64ToAuxInt(kind)
9349 v.AddArg3(x, y, mem)
9350 return true
9351 }
9352
9353
9354
9355 for {
9356 kind := auxIntToInt64(v.AuxInt)
9357 x := v_0
9358 y := v_1
9359 mem := v_2
9360 if !(boundsABI(kind) == 2) {
9361 break
9362 }
9363 v.reset(Op386LoweredPanicBoundsC)
9364 v.AuxInt = int64ToAuxInt(kind)
9365 v.AddArg3(x, y, mem)
9366 return true
9367 }
9368 return false
9369 }
9370 func rewriteValue386_OpPanicExtend(v *Value) bool {
9371 v_3 := v.Args[3]
9372 v_2 := v.Args[2]
9373 v_1 := v.Args[1]
9374 v_0 := v.Args[0]
9375
9376
9377
9378 for {
9379 kind := auxIntToInt64(v.AuxInt)
9380 hi := v_0
9381 lo := v_1
9382 y := v_2
9383 mem := v_3
9384 if !(boundsABI(kind) == 0) {
9385 break
9386 }
9387 v.reset(Op386LoweredPanicExtendA)
9388 v.AuxInt = int64ToAuxInt(kind)
9389 v.AddArg4(hi, lo, y, mem)
9390 return true
9391 }
9392
9393
9394
9395 for {
9396 kind := auxIntToInt64(v.AuxInt)
9397 hi := v_0
9398 lo := v_1
9399 y := v_2
9400 mem := v_3
9401 if !(boundsABI(kind) == 1) {
9402 break
9403 }
9404 v.reset(Op386LoweredPanicExtendB)
9405 v.AuxInt = int64ToAuxInt(kind)
9406 v.AddArg4(hi, lo, y, mem)
9407 return true
9408 }
9409
9410
9411
9412 for {
9413 kind := auxIntToInt64(v.AuxInt)
9414 hi := v_0
9415 lo := v_1
9416 y := v_2
9417 mem := v_3
9418 if !(boundsABI(kind) == 2) {
9419 break
9420 }
9421 v.reset(Op386LoweredPanicExtendC)
9422 v.AuxInt = int64ToAuxInt(kind)
9423 v.AddArg4(hi, lo, y, mem)
9424 return true
9425 }
9426 return false
9427 }
9428 func rewriteValue386_OpRsh16Ux16(v *Value) bool {
9429 v_1 := v.Args[1]
9430 v_0 := v.Args[0]
9431 b := v.Block
9432
9433
9434
9435 for {
9436 t := v.Type
9437 x := v_0
9438 y := v_1
9439 if !(!shiftIsBounded(v)) {
9440 break
9441 }
9442 v.reset(Op386ANDL)
9443 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
9444 v0.AddArg2(x, y)
9445 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9446 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9447 v2.AuxInt = int16ToAuxInt(16)
9448 v2.AddArg(y)
9449 v1.AddArg(v2)
9450 v.AddArg2(v0, v1)
9451 return true
9452 }
9453
9454
9455
9456 for {
9457 t := v.Type
9458 x := v_0
9459 y := v_1
9460 if !(shiftIsBounded(v)) {
9461 break
9462 }
9463 v.reset(Op386SHRW)
9464 v.Type = t
9465 v.AddArg2(x, y)
9466 return true
9467 }
9468 return false
9469 }
9470 func rewriteValue386_OpRsh16Ux32(v *Value) bool {
9471 v_1 := v.Args[1]
9472 v_0 := v.Args[0]
9473 b := v.Block
9474
9475
9476
9477 for {
9478 t := v.Type
9479 x := v_0
9480 y := v_1
9481 if !(!shiftIsBounded(v)) {
9482 break
9483 }
9484 v.reset(Op386ANDL)
9485 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
9486 v0.AddArg2(x, y)
9487 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9488 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9489 v2.AuxInt = int32ToAuxInt(16)
9490 v2.AddArg(y)
9491 v1.AddArg(v2)
9492 v.AddArg2(v0, v1)
9493 return true
9494 }
9495
9496
9497
9498 for {
9499 t := v.Type
9500 x := v_0
9501 y := v_1
9502 if !(shiftIsBounded(v)) {
9503 break
9504 }
9505 v.reset(Op386SHRW)
9506 v.Type = t
9507 v.AddArg2(x, y)
9508 return true
9509 }
9510 return false
9511 }
9512 func rewriteValue386_OpRsh16Ux64(v *Value) bool {
9513 v_1 := v.Args[1]
9514 v_0 := v.Args[0]
9515
9516
9517
9518 for {
9519 x := v_0
9520 if v_1.Op != OpConst64 {
9521 break
9522 }
9523 c := auxIntToInt64(v_1.AuxInt)
9524 if !(uint64(c) < 16) {
9525 break
9526 }
9527 v.reset(Op386SHRWconst)
9528 v.AuxInt = int16ToAuxInt(int16(c))
9529 v.AddArg(x)
9530 return true
9531 }
9532
9533
9534
9535 for {
9536 if v_1.Op != OpConst64 {
9537 break
9538 }
9539 c := auxIntToInt64(v_1.AuxInt)
9540 if !(uint64(c) >= 16) {
9541 break
9542 }
9543 v.reset(OpConst16)
9544 v.AuxInt = int16ToAuxInt(0)
9545 return true
9546 }
9547 return false
9548 }
9549 func rewriteValue386_OpRsh16Ux8(v *Value) bool {
9550 v_1 := v.Args[1]
9551 v_0 := v.Args[0]
9552 b := v.Block
9553
9554
9555
9556 for {
9557 t := v.Type
9558 x := v_0
9559 y := v_1
9560 if !(!shiftIsBounded(v)) {
9561 break
9562 }
9563 v.reset(Op386ANDL)
9564 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
9565 v0.AddArg2(x, y)
9566 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9567 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9568 v2.AuxInt = int8ToAuxInt(16)
9569 v2.AddArg(y)
9570 v1.AddArg(v2)
9571 v.AddArg2(v0, v1)
9572 return true
9573 }
9574
9575
9576
9577 for {
9578 t := v.Type
9579 x := v_0
9580 y := v_1
9581 if !(shiftIsBounded(v)) {
9582 break
9583 }
9584 v.reset(Op386SHRW)
9585 v.Type = t
9586 v.AddArg2(x, y)
9587 return true
9588 }
9589 return false
9590 }
9591 func rewriteValue386_OpRsh16x16(v *Value) bool {
9592 v_1 := v.Args[1]
9593 v_0 := v.Args[0]
9594 b := v.Block
9595
9596
9597
9598 for {
9599 t := v.Type
9600 x := v_0
9601 y := v_1
9602 if !(!shiftIsBounded(v)) {
9603 break
9604 }
9605 v.reset(Op386SARW)
9606 v.Type = t
9607 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
9608 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
9609 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
9610 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9611 v3.AuxInt = int16ToAuxInt(16)
9612 v3.AddArg(y)
9613 v2.AddArg(v3)
9614 v1.AddArg(v2)
9615 v0.AddArg2(y, v1)
9616 v.AddArg2(x, v0)
9617 return true
9618 }
9619
9620
9621
9622 for {
9623 x := v_0
9624 y := v_1
9625 if !(shiftIsBounded(v)) {
9626 break
9627 }
9628 v.reset(Op386SARW)
9629 v.AddArg2(x, y)
9630 return true
9631 }
9632 return false
9633 }
9634 func rewriteValue386_OpRsh16x32(v *Value) bool {
9635 v_1 := v.Args[1]
9636 v_0 := v.Args[0]
9637 b := v.Block
9638
9639
9640
9641 for {
9642 t := v.Type
9643 x := v_0
9644 y := v_1
9645 if !(!shiftIsBounded(v)) {
9646 break
9647 }
9648 v.reset(Op386SARW)
9649 v.Type = t
9650 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
9651 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
9652 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
9653 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9654 v3.AuxInt = int32ToAuxInt(16)
9655 v3.AddArg(y)
9656 v2.AddArg(v3)
9657 v1.AddArg(v2)
9658 v0.AddArg2(y, v1)
9659 v.AddArg2(x, v0)
9660 return true
9661 }
9662
9663
9664
9665 for {
9666 x := v_0
9667 y := v_1
9668 if !(shiftIsBounded(v)) {
9669 break
9670 }
9671 v.reset(Op386SARW)
9672 v.AddArg2(x, y)
9673 return true
9674 }
9675 return false
9676 }
9677 func rewriteValue386_OpRsh16x64(v *Value) bool {
9678 v_1 := v.Args[1]
9679 v_0 := v.Args[0]
9680
9681
9682
9683 for {
9684 x := v_0
9685 if v_1.Op != OpConst64 {
9686 break
9687 }
9688 c := auxIntToInt64(v_1.AuxInt)
9689 if !(uint64(c) < 16) {
9690 break
9691 }
9692 v.reset(Op386SARWconst)
9693 v.AuxInt = int16ToAuxInt(int16(c))
9694 v.AddArg(x)
9695 return true
9696 }
9697
9698
9699
9700 for {
9701 x := v_0
9702 if v_1.Op != OpConst64 {
9703 break
9704 }
9705 c := auxIntToInt64(v_1.AuxInt)
9706 if !(uint64(c) >= 16) {
9707 break
9708 }
9709 v.reset(Op386SARWconst)
9710 v.AuxInt = int16ToAuxInt(15)
9711 v.AddArg(x)
9712 return true
9713 }
9714 return false
9715 }
9716 func rewriteValue386_OpRsh16x8(v *Value) bool {
9717 v_1 := v.Args[1]
9718 v_0 := v.Args[0]
9719 b := v.Block
9720
9721
9722
9723 for {
9724 t := v.Type
9725 x := v_0
9726 y := v_1
9727 if !(!shiftIsBounded(v)) {
9728 break
9729 }
9730 v.reset(Op386SARW)
9731 v.Type = t
9732 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
9733 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
9734 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
9735 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9736 v3.AuxInt = int8ToAuxInt(16)
9737 v3.AddArg(y)
9738 v2.AddArg(v3)
9739 v1.AddArg(v2)
9740 v0.AddArg2(y, v1)
9741 v.AddArg2(x, v0)
9742 return true
9743 }
9744
9745
9746
9747 for {
9748 x := v_0
9749 y := v_1
9750 if !(shiftIsBounded(v)) {
9751 break
9752 }
9753 v.reset(Op386SARW)
9754 v.AddArg2(x, y)
9755 return true
9756 }
9757 return false
9758 }
9759 func rewriteValue386_OpRsh32Ux16(v *Value) bool {
9760 v_1 := v.Args[1]
9761 v_0 := v.Args[0]
9762 b := v.Block
9763
9764
9765
9766 for {
9767 t := v.Type
9768 x := v_0
9769 y := v_1
9770 if !(!shiftIsBounded(v)) {
9771 break
9772 }
9773 v.reset(Op386ANDL)
9774 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
9775 v0.AddArg2(x, y)
9776 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9777 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9778 v2.AuxInt = int16ToAuxInt(32)
9779 v2.AddArg(y)
9780 v1.AddArg(v2)
9781 v.AddArg2(v0, v1)
9782 return true
9783 }
9784
9785
9786
9787 for {
9788 t := v.Type
9789 x := v_0
9790 y := v_1
9791 if !(shiftIsBounded(v)) {
9792 break
9793 }
9794 v.reset(Op386SHRL)
9795 v.Type = t
9796 v.AddArg2(x, y)
9797 return true
9798 }
9799 return false
9800 }
9801 func rewriteValue386_OpRsh32Ux32(v *Value) bool {
9802 v_1 := v.Args[1]
9803 v_0 := v.Args[0]
9804 b := v.Block
9805
9806
9807
9808 for {
9809 t := v.Type
9810 x := v_0
9811 y := v_1
9812 if !(!shiftIsBounded(v)) {
9813 break
9814 }
9815 v.reset(Op386ANDL)
9816 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
9817 v0.AddArg2(x, y)
9818 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9819 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9820 v2.AuxInt = int32ToAuxInt(32)
9821 v2.AddArg(y)
9822 v1.AddArg(v2)
9823 v.AddArg2(v0, v1)
9824 return true
9825 }
9826
9827
9828
9829 for {
9830 t := v.Type
9831 x := v_0
9832 y := v_1
9833 if !(shiftIsBounded(v)) {
9834 break
9835 }
9836 v.reset(Op386SHRL)
9837 v.Type = t
9838 v.AddArg2(x, y)
9839 return true
9840 }
9841 return false
9842 }
9843 func rewriteValue386_OpRsh32Ux64(v *Value) bool {
9844 v_1 := v.Args[1]
9845 v_0 := v.Args[0]
9846
9847
9848
9849 for {
9850 x := v_0
9851 if v_1.Op != OpConst64 {
9852 break
9853 }
9854 c := auxIntToInt64(v_1.AuxInt)
9855 if !(uint64(c) < 32) {
9856 break
9857 }
9858 v.reset(Op386SHRLconst)
9859 v.AuxInt = int32ToAuxInt(int32(c))
9860 v.AddArg(x)
9861 return true
9862 }
9863
9864
9865
9866 for {
9867 if v_1.Op != OpConst64 {
9868 break
9869 }
9870 c := auxIntToInt64(v_1.AuxInt)
9871 if !(uint64(c) >= 32) {
9872 break
9873 }
9874 v.reset(OpConst32)
9875 v.AuxInt = int32ToAuxInt(0)
9876 return true
9877 }
9878 return false
9879 }
9880 func rewriteValue386_OpRsh32Ux8(v *Value) bool {
9881 v_1 := v.Args[1]
9882 v_0 := v.Args[0]
9883 b := v.Block
9884
9885
9886
9887 for {
9888 t := v.Type
9889 x := v_0
9890 y := v_1
9891 if !(!shiftIsBounded(v)) {
9892 break
9893 }
9894 v.reset(Op386ANDL)
9895 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
9896 v0.AddArg2(x, y)
9897 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9898 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9899 v2.AuxInt = int8ToAuxInt(32)
9900 v2.AddArg(y)
9901 v1.AddArg(v2)
9902 v.AddArg2(v0, v1)
9903 return true
9904 }
9905
9906
9907
9908 for {
9909 t := v.Type
9910 x := v_0
9911 y := v_1
9912 if !(shiftIsBounded(v)) {
9913 break
9914 }
9915 v.reset(Op386SHRL)
9916 v.Type = t
9917 v.AddArg2(x, y)
9918 return true
9919 }
9920 return false
9921 }
9922 func rewriteValue386_OpRsh32x16(v *Value) bool {
9923 v_1 := v.Args[1]
9924 v_0 := v.Args[0]
9925 b := v.Block
9926
9927
9928
9929 for {
9930 t := v.Type
9931 x := v_0
9932 y := v_1
9933 if !(!shiftIsBounded(v)) {
9934 break
9935 }
9936 v.reset(Op386SARL)
9937 v.Type = t
9938 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
9939 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
9940 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
9941 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9942 v3.AuxInt = int16ToAuxInt(32)
9943 v3.AddArg(y)
9944 v2.AddArg(v3)
9945 v1.AddArg(v2)
9946 v0.AddArg2(y, v1)
9947 v.AddArg2(x, v0)
9948 return true
9949 }
9950
9951
9952
9953 for {
9954 x := v_0
9955 y := v_1
9956 if !(shiftIsBounded(v)) {
9957 break
9958 }
9959 v.reset(Op386SARL)
9960 v.AddArg2(x, y)
9961 return true
9962 }
9963 return false
9964 }
9965 func rewriteValue386_OpRsh32x32(v *Value) bool {
9966 v_1 := v.Args[1]
9967 v_0 := v.Args[0]
9968 b := v.Block
9969
9970
9971
9972 for {
9973 t := v.Type
9974 x := v_0
9975 y := v_1
9976 if !(!shiftIsBounded(v)) {
9977 break
9978 }
9979 v.reset(Op386SARL)
9980 v.Type = t
9981 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
9982 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
9983 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
9984 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9985 v3.AuxInt = int32ToAuxInt(32)
9986 v3.AddArg(y)
9987 v2.AddArg(v3)
9988 v1.AddArg(v2)
9989 v0.AddArg2(y, v1)
9990 v.AddArg2(x, v0)
9991 return true
9992 }
9993
9994
9995
9996 for {
9997 x := v_0
9998 y := v_1
9999 if !(shiftIsBounded(v)) {
10000 break
10001 }
10002 v.reset(Op386SARL)
10003 v.AddArg2(x, y)
10004 return true
10005 }
10006 return false
10007 }
10008 func rewriteValue386_OpRsh32x64(v *Value) bool {
10009 v_1 := v.Args[1]
10010 v_0 := v.Args[0]
10011
10012
10013
10014 for {
10015 x := v_0
10016 if v_1.Op != OpConst64 {
10017 break
10018 }
10019 c := auxIntToInt64(v_1.AuxInt)
10020 if !(uint64(c) < 32) {
10021 break
10022 }
10023 v.reset(Op386SARLconst)
10024 v.AuxInt = int32ToAuxInt(int32(c))
10025 v.AddArg(x)
10026 return true
10027 }
10028
10029
10030
10031 for {
10032 x := v_0
10033 if v_1.Op != OpConst64 {
10034 break
10035 }
10036 c := auxIntToInt64(v_1.AuxInt)
10037 if !(uint64(c) >= 32) {
10038 break
10039 }
10040 v.reset(Op386SARLconst)
10041 v.AuxInt = int32ToAuxInt(31)
10042 v.AddArg(x)
10043 return true
10044 }
10045 return false
10046 }
10047 func rewriteValue386_OpRsh32x8(v *Value) bool {
10048 v_1 := v.Args[1]
10049 v_0 := v.Args[0]
10050 b := v.Block
10051
10052
10053
10054 for {
10055 t := v.Type
10056 x := v_0
10057 y := v_1
10058 if !(!shiftIsBounded(v)) {
10059 break
10060 }
10061 v.reset(Op386SARL)
10062 v.Type = t
10063 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10064 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10065 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10066 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10067 v3.AuxInt = int8ToAuxInt(32)
10068 v3.AddArg(y)
10069 v2.AddArg(v3)
10070 v1.AddArg(v2)
10071 v0.AddArg2(y, v1)
10072 v.AddArg2(x, v0)
10073 return true
10074 }
10075
10076
10077
10078 for {
10079 x := v_0
10080 y := v_1
10081 if !(shiftIsBounded(v)) {
10082 break
10083 }
10084 v.reset(Op386SARL)
10085 v.AddArg2(x, y)
10086 return true
10087 }
10088 return false
10089 }
10090 func rewriteValue386_OpRsh8Ux16(v *Value) bool {
10091 v_1 := v.Args[1]
10092 v_0 := v.Args[0]
10093 b := v.Block
10094
10095
10096
10097 for {
10098 t := v.Type
10099 x := v_0
10100 y := v_1
10101 if !(!shiftIsBounded(v)) {
10102 break
10103 }
10104 v.reset(Op386ANDL)
10105 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
10106 v0.AddArg2(x, y)
10107 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10108 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10109 v2.AuxInt = int16ToAuxInt(8)
10110 v2.AddArg(y)
10111 v1.AddArg(v2)
10112 v.AddArg2(v0, v1)
10113 return true
10114 }
10115
10116
10117
10118 for {
10119 t := v.Type
10120 x := v_0
10121 y := v_1
10122 if !(shiftIsBounded(v)) {
10123 break
10124 }
10125 v.reset(Op386SHRB)
10126 v.Type = t
10127 v.AddArg2(x, y)
10128 return true
10129 }
10130 return false
10131 }
10132 func rewriteValue386_OpRsh8Ux32(v *Value) bool {
10133 v_1 := v.Args[1]
10134 v_0 := v.Args[0]
10135 b := v.Block
10136
10137
10138
10139 for {
10140 t := v.Type
10141 x := v_0
10142 y := v_1
10143 if !(!shiftIsBounded(v)) {
10144 break
10145 }
10146 v.reset(Op386ANDL)
10147 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
10148 v0.AddArg2(x, y)
10149 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10150 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10151 v2.AuxInt = int32ToAuxInt(8)
10152 v2.AddArg(y)
10153 v1.AddArg(v2)
10154 v.AddArg2(v0, v1)
10155 return true
10156 }
10157
10158
10159
10160 for {
10161 t := v.Type
10162 x := v_0
10163 y := v_1
10164 if !(shiftIsBounded(v)) {
10165 break
10166 }
10167 v.reset(Op386SHRB)
10168 v.Type = t
10169 v.AddArg2(x, y)
10170 return true
10171 }
10172 return false
10173 }
10174 func rewriteValue386_OpRsh8Ux64(v *Value) bool {
10175 v_1 := v.Args[1]
10176 v_0 := v.Args[0]
10177
10178
10179
10180 for {
10181 x := v_0
10182 if v_1.Op != OpConst64 {
10183 break
10184 }
10185 c := auxIntToInt64(v_1.AuxInt)
10186 if !(uint64(c) < 8) {
10187 break
10188 }
10189 v.reset(Op386SHRBconst)
10190 v.AuxInt = int8ToAuxInt(int8(c))
10191 v.AddArg(x)
10192 return true
10193 }
10194
10195
10196
10197 for {
10198 if v_1.Op != OpConst64 {
10199 break
10200 }
10201 c := auxIntToInt64(v_1.AuxInt)
10202 if !(uint64(c) >= 8) {
10203 break
10204 }
10205 v.reset(OpConst8)
10206 v.AuxInt = int8ToAuxInt(0)
10207 return true
10208 }
10209 return false
10210 }
10211 func rewriteValue386_OpRsh8Ux8(v *Value) bool {
10212 v_1 := v.Args[1]
10213 v_0 := v.Args[0]
10214 b := v.Block
10215
10216
10217
10218 for {
10219 t := v.Type
10220 x := v_0
10221 y := v_1
10222 if !(!shiftIsBounded(v)) {
10223 break
10224 }
10225 v.reset(Op386ANDL)
10226 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
10227 v0.AddArg2(x, y)
10228 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10229 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10230 v2.AuxInt = int8ToAuxInt(8)
10231 v2.AddArg(y)
10232 v1.AddArg(v2)
10233 v.AddArg2(v0, v1)
10234 return true
10235 }
10236
10237
10238
10239 for {
10240 t := v.Type
10241 x := v_0
10242 y := v_1
10243 if !(shiftIsBounded(v)) {
10244 break
10245 }
10246 v.reset(Op386SHRB)
10247 v.Type = t
10248 v.AddArg2(x, y)
10249 return true
10250 }
10251 return false
10252 }
10253 func rewriteValue386_OpRsh8x16(v *Value) bool {
10254 v_1 := v.Args[1]
10255 v_0 := v.Args[0]
10256 b := v.Block
10257
10258
10259
10260 for {
10261 t := v.Type
10262 x := v_0
10263 y := v_1
10264 if !(!shiftIsBounded(v)) {
10265 break
10266 }
10267 v.reset(Op386SARB)
10268 v.Type = t
10269 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10270 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10271 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10272 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10273 v3.AuxInt = int16ToAuxInt(8)
10274 v3.AddArg(y)
10275 v2.AddArg(v3)
10276 v1.AddArg(v2)
10277 v0.AddArg2(y, v1)
10278 v.AddArg2(x, v0)
10279 return true
10280 }
10281
10282
10283
10284 for {
10285 x := v_0
10286 y := v_1
10287 if !(shiftIsBounded(v)) {
10288 break
10289 }
10290 v.reset(Op386SARB)
10291 v.AddArg2(x, y)
10292 return true
10293 }
10294 return false
10295 }
10296 func rewriteValue386_OpRsh8x32(v *Value) bool {
10297 v_1 := v.Args[1]
10298 v_0 := v.Args[0]
10299 b := v.Block
10300
10301
10302
10303 for {
10304 t := v.Type
10305 x := v_0
10306 y := v_1
10307 if !(!shiftIsBounded(v)) {
10308 break
10309 }
10310 v.reset(Op386SARB)
10311 v.Type = t
10312 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10313 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10314 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10315 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10316 v3.AuxInt = int32ToAuxInt(8)
10317 v3.AddArg(y)
10318 v2.AddArg(v3)
10319 v1.AddArg(v2)
10320 v0.AddArg2(y, v1)
10321 v.AddArg2(x, v0)
10322 return true
10323 }
10324
10325
10326
10327 for {
10328 x := v_0
10329 y := v_1
10330 if !(shiftIsBounded(v)) {
10331 break
10332 }
10333 v.reset(Op386SARB)
10334 v.AddArg2(x, y)
10335 return true
10336 }
10337 return false
10338 }
10339 func rewriteValue386_OpRsh8x64(v *Value) bool {
10340 v_1 := v.Args[1]
10341 v_0 := v.Args[0]
10342
10343
10344
10345 for {
10346 x := v_0
10347 if v_1.Op != OpConst64 {
10348 break
10349 }
10350 c := auxIntToInt64(v_1.AuxInt)
10351 if !(uint64(c) < 8) {
10352 break
10353 }
10354 v.reset(Op386SARBconst)
10355 v.AuxInt = int8ToAuxInt(int8(c))
10356 v.AddArg(x)
10357 return true
10358 }
10359
10360
10361
10362 for {
10363 x := v_0
10364 if v_1.Op != OpConst64 {
10365 break
10366 }
10367 c := auxIntToInt64(v_1.AuxInt)
10368 if !(uint64(c) >= 8) {
10369 break
10370 }
10371 v.reset(Op386SARBconst)
10372 v.AuxInt = int8ToAuxInt(7)
10373 v.AddArg(x)
10374 return true
10375 }
10376 return false
10377 }
10378 func rewriteValue386_OpRsh8x8(v *Value) bool {
10379 v_1 := v.Args[1]
10380 v_0 := v.Args[0]
10381 b := v.Block
10382
10383
10384
10385 for {
10386 t := v.Type
10387 x := v_0
10388 y := v_1
10389 if !(!shiftIsBounded(v)) {
10390 break
10391 }
10392 v.reset(Op386SARB)
10393 v.Type = t
10394 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10395 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10396 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10397 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10398 v3.AuxInt = int8ToAuxInt(8)
10399 v3.AddArg(y)
10400 v2.AddArg(v3)
10401 v1.AddArg(v2)
10402 v0.AddArg2(y, v1)
10403 v.AddArg2(x, v0)
10404 return true
10405 }
10406
10407
10408
10409 for {
10410 x := v_0
10411 y := v_1
10412 if !(shiftIsBounded(v)) {
10413 break
10414 }
10415 v.reset(Op386SARB)
10416 v.AddArg2(x, y)
10417 return true
10418 }
10419 return false
10420 }
10421 func rewriteValue386_OpSelect0(v *Value) bool {
10422 v_0 := v.Args[0]
10423 b := v.Block
10424 typ := &b.Func.Config.Types
10425
10426
10427 for {
10428 if v_0.Op != OpMul32uover {
10429 break
10430 }
10431 y := v_0.Args[1]
10432 x := v_0.Args[0]
10433 v.reset(OpSelect0)
10434 v.Type = typ.UInt32
10435 v0 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
10436 v0.AddArg2(x, y)
10437 v.AddArg(v0)
10438 return true
10439 }
10440 return false
10441 }
10442 func rewriteValue386_OpSelect1(v *Value) bool {
10443 v_0 := v.Args[0]
10444 b := v.Block
10445 typ := &b.Func.Config.Types
10446
10447
10448 for {
10449 if v_0.Op != OpMul32uover {
10450 break
10451 }
10452 y := v_0.Args[1]
10453 x := v_0.Args[0]
10454 v.reset(Op386SETO)
10455 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
10456 v1 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
10457 v1.AddArg2(x, y)
10458 v0.AddArg(v1)
10459 v.AddArg(v0)
10460 return true
10461 }
10462 return false
10463 }
10464 func rewriteValue386_OpSignmask(v *Value) bool {
10465 v_0 := v.Args[0]
10466
10467
10468 for {
10469 x := v_0
10470 v.reset(Op386SARLconst)
10471 v.AuxInt = int32ToAuxInt(31)
10472 v.AddArg(x)
10473 return true
10474 }
10475 }
10476 func rewriteValue386_OpSlicemask(v *Value) bool {
10477 v_0 := v.Args[0]
10478 b := v.Block
10479
10480
10481 for {
10482 t := v.Type
10483 x := v_0
10484 v.reset(Op386SARLconst)
10485 v.AuxInt = int32ToAuxInt(31)
10486 v0 := b.NewValue0(v.Pos, Op386NEGL, t)
10487 v0.AddArg(x)
10488 v.AddArg(v0)
10489 return true
10490 }
10491 }
10492 func rewriteValue386_OpStore(v *Value) bool {
10493 v_2 := v.Args[2]
10494 v_1 := v.Args[1]
10495 v_0 := v.Args[0]
10496
10497
10498
10499 for {
10500 t := auxToType(v.Aux)
10501 ptr := v_0
10502 val := v_1
10503 mem := v_2
10504 if !(t.Size() == 8 && t.IsFloat()) {
10505 break
10506 }
10507 v.reset(Op386MOVSDstore)
10508 v.AddArg3(ptr, val, mem)
10509 return true
10510 }
10511
10512
10513
10514 for {
10515 t := auxToType(v.Aux)
10516 ptr := v_0
10517 val := v_1
10518 mem := v_2
10519 if !(t.Size() == 4 && t.IsFloat()) {
10520 break
10521 }
10522 v.reset(Op386MOVSSstore)
10523 v.AddArg3(ptr, val, mem)
10524 return true
10525 }
10526
10527
10528
10529 for {
10530 t := auxToType(v.Aux)
10531 ptr := v_0
10532 val := v_1
10533 mem := v_2
10534 if !(t.Size() == 4 && !t.IsFloat()) {
10535 break
10536 }
10537 v.reset(Op386MOVLstore)
10538 v.AddArg3(ptr, val, mem)
10539 return true
10540 }
10541
10542
10543
10544 for {
10545 t := auxToType(v.Aux)
10546 ptr := v_0
10547 val := v_1
10548 mem := v_2
10549 if !(t.Size() == 2) {
10550 break
10551 }
10552 v.reset(Op386MOVWstore)
10553 v.AddArg3(ptr, val, mem)
10554 return true
10555 }
10556
10557
10558
10559 for {
10560 t := auxToType(v.Aux)
10561 ptr := v_0
10562 val := v_1
10563 mem := v_2
10564 if !(t.Size() == 1) {
10565 break
10566 }
10567 v.reset(Op386MOVBstore)
10568 v.AddArg3(ptr, val, mem)
10569 return true
10570 }
10571 return false
10572 }
10573 func rewriteValue386_OpZero(v *Value) bool {
10574 v_1 := v.Args[1]
10575 v_0 := v.Args[0]
10576 b := v.Block
10577 typ := &b.Func.Config.Types
10578
10579
10580 for {
10581 if auxIntToInt64(v.AuxInt) != 0 {
10582 break
10583 }
10584 mem := v_1
10585 v.copyOf(mem)
10586 return true
10587 }
10588
10589
10590 for {
10591 if auxIntToInt64(v.AuxInt) != 1 {
10592 break
10593 }
10594 destptr := v_0
10595 mem := v_1
10596 v.reset(Op386MOVBstoreconst)
10597 v.AuxInt = valAndOffToAuxInt(0)
10598 v.AddArg2(destptr, mem)
10599 return true
10600 }
10601
10602
10603 for {
10604 if auxIntToInt64(v.AuxInt) != 2 {
10605 break
10606 }
10607 destptr := v_0
10608 mem := v_1
10609 v.reset(Op386MOVWstoreconst)
10610 v.AuxInt = valAndOffToAuxInt(0)
10611 v.AddArg2(destptr, mem)
10612 return true
10613 }
10614
10615
10616 for {
10617 if auxIntToInt64(v.AuxInt) != 4 {
10618 break
10619 }
10620 destptr := v_0
10621 mem := v_1
10622 v.reset(Op386MOVLstoreconst)
10623 v.AuxInt = valAndOffToAuxInt(0)
10624 v.AddArg2(destptr, mem)
10625 return true
10626 }
10627
10628
10629 for {
10630 if auxIntToInt64(v.AuxInt) != 3 {
10631 break
10632 }
10633 destptr := v_0
10634 mem := v_1
10635 v.reset(Op386MOVBstoreconst)
10636 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 2))
10637 v0 := b.NewValue0(v.Pos, Op386MOVWstoreconst, types.TypeMem)
10638 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10639 v0.AddArg2(destptr, mem)
10640 v.AddArg2(destptr, v0)
10641 return true
10642 }
10643
10644
10645 for {
10646 if auxIntToInt64(v.AuxInt) != 5 {
10647 break
10648 }
10649 destptr := v_0
10650 mem := v_1
10651 v.reset(Op386MOVBstoreconst)
10652 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
10653 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10654 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10655 v0.AddArg2(destptr, mem)
10656 v.AddArg2(destptr, v0)
10657 return true
10658 }
10659
10660
10661 for {
10662 if auxIntToInt64(v.AuxInt) != 6 {
10663 break
10664 }
10665 destptr := v_0
10666 mem := v_1
10667 v.reset(Op386MOVWstoreconst)
10668 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
10669 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10670 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10671 v0.AddArg2(destptr, mem)
10672 v.AddArg2(destptr, v0)
10673 return true
10674 }
10675
10676
10677 for {
10678 if auxIntToInt64(v.AuxInt) != 7 {
10679 break
10680 }
10681 destptr := v_0
10682 mem := v_1
10683 v.reset(Op386MOVLstoreconst)
10684 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 3))
10685 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10686 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10687 v0.AddArg2(destptr, mem)
10688 v.AddArg2(destptr, v0)
10689 return true
10690 }
10691
10692
10693
10694 for {
10695 s := auxIntToInt64(v.AuxInt)
10696 destptr := v_0
10697 mem := v_1
10698 if !(s%4 != 0 && s > 4) {
10699 break
10700 }
10701 v.reset(OpZero)
10702 v.AuxInt = int64ToAuxInt(s - s%4)
10703 v0 := b.NewValue0(v.Pos, Op386ADDLconst, typ.UInt32)
10704 v0.AuxInt = int32ToAuxInt(int32(s % 4))
10705 v0.AddArg(destptr)
10706 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10707 v1.AuxInt = valAndOffToAuxInt(0)
10708 v1.AddArg2(destptr, mem)
10709 v.AddArg2(v0, v1)
10710 return true
10711 }
10712
10713
10714 for {
10715 if auxIntToInt64(v.AuxInt) != 8 {
10716 break
10717 }
10718 destptr := v_0
10719 mem := v_1
10720 v.reset(Op386MOVLstoreconst)
10721 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
10722 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10723 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10724 v0.AddArg2(destptr, mem)
10725 v.AddArg2(destptr, v0)
10726 return true
10727 }
10728
10729
10730 for {
10731 if auxIntToInt64(v.AuxInt) != 12 {
10732 break
10733 }
10734 destptr := v_0
10735 mem := v_1
10736 v.reset(Op386MOVLstoreconst)
10737 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
10738 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10739 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
10740 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10741 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10742 v1.AddArg2(destptr, mem)
10743 v0.AddArg2(destptr, v1)
10744 v.AddArg2(destptr, v0)
10745 return true
10746 }
10747
10748
10749 for {
10750 if auxIntToInt64(v.AuxInt) != 16 {
10751 break
10752 }
10753 destptr := v_0
10754 mem := v_1
10755 v.reset(Op386MOVLstoreconst)
10756 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 12))
10757 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10758 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
10759 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10760 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
10761 v2 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
10762 v2.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
10763 v2.AddArg2(destptr, mem)
10764 v1.AddArg2(destptr, v2)
10765 v0.AddArg2(destptr, v1)
10766 v.AddArg2(destptr, v0)
10767 return true
10768 }
10769
10770
10771
10772 for {
10773 s := auxIntToInt64(v.AuxInt)
10774 destptr := v_0
10775 mem := v_1
10776 if !(s > 16 && s <= 4*128 && s%4 == 0) {
10777 break
10778 }
10779 v.reset(Op386DUFFZERO)
10780 v.AuxInt = int64ToAuxInt(1 * (128 - s/4))
10781 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
10782 v0.AuxInt = int32ToAuxInt(0)
10783 v.AddArg3(destptr, v0, mem)
10784 return true
10785 }
10786
10787
10788
10789 for {
10790 s := auxIntToInt64(v.AuxInt)
10791 destptr := v_0
10792 mem := v_1
10793 if !(s > 4*128 && s%4 == 0) {
10794 break
10795 }
10796 v.reset(Op386REPSTOSL)
10797 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
10798 v0.AuxInt = int32ToAuxInt(int32(s / 4))
10799 v1 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
10800 v1.AuxInt = int32ToAuxInt(0)
10801 v.AddArg4(destptr, v0, v1, mem)
10802 return true
10803 }
10804 return false
10805 }
10806 func rewriteValue386_OpZeromask(v *Value) bool {
10807 v_0 := v.Args[0]
10808 b := v.Block
10809
10810
10811 for {
10812 t := v.Type
10813 x := v_0
10814 v.reset(Op386XORLconst)
10815 v.AuxInt = int32ToAuxInt(-1)
10816 v0 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10817 v1 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10818 v1.AuxInt = int32ToAuxInt(1)
10819 v1.AddArg(x)
10820 v0.AddArg(v1)
10821 v.AddArg(v0)
10822 return true
10823 }
10824 }
10825 func rewriteBlock386(b *Block) bool {
10826 switch b.Kind {
10827 case Block386EQ:
10828
10829
10830 for b.Controls[0].Op == Op386InvertFlags {
10831 v_0 := b.Controls[0]
10832 cmp := v_0.Args[0]
10833 b.resetWithControl(Block386EQ, cmp)
10834 return true
10835 }
10836
10837
10838 for b.Controls[0].Op == Op386FlagEQ {
10839 b.Reset(BlockFirst)
10840 return true
10841 }
10842
10843
10844 for b.Controls[0].Op == Op386FlagLT_ULT {
10845 b.Reset(BlockFirst)
10846 b.swapSuccessors()
10847 return true
10848 }
10849
10850
10851 for b.Controls[0].Op == Op386FlagLT_UGT {
10852 b.Reset(BlockFirst)
10853 b.swapSuccessors()
10854 return true
10855 }
10856
10857
10858 for b.Controls[0].Op == Op386FlagGT_ULT {
10859 b.Reset(BlockFirst)
10860 b.swapSuccessors()
10861 return true
10862 }
10863
10864
10865 for b.Controls[0].Op == Op386FlagGT_UGT {
10866 b.Reset(BlockFirst)
10867 b.swapSuccessors()
10868 return true
10869 }
10870 case Block386GE:
10871
10872
10873 for b.Controls[0].Op == Op386InvertFlags {
10874 v_0 := b.Controls[0]
10875 cmp := v_0.Args[0]
10876 b.resetWithControl(Block386LE, cmp)
10877 return true
10878 }
10879
10880
10881 for b.Controls[0].Op == Op386FlagEQ {
10882 b.Reset(BlockFirst)
10883 return true
10884 }
10885
10886
10887 for b.Controls[0].Op == Op386FlagLT_ULT {
10888 b.Reset(BlockFirst)
10889 b.swapSuccessors()
10890 return true
10891 }
10892
10893
10894 for b.Controls[0].Op == Op386FlagLT_UGT {
10895 b.Reset(BlockFirst)
10896 b.swapSuccessors()
10897 return true
10898 }
10899
10900
10901 for b.Controls[0].Op == Op386FlagGT_ULT {
10902 b.Reset(BlockFirst)
10903 return true
10904 }
10905
10906
10907 for b.Controls[0].Op == Op386FlagGT_UGT {
10908 b.Reset(BlockFirst)
10909 return true
10910 }
10911 case Block386GT:
10912
10913
10914 for b.Controls[0].Op == Op386InvertFlags {
10915 v_0 := b.Controls[0]
10916 cmp := v_0.Args[0]
10917 b.resetWithControl(Block386LT, cmp)
10918 return true
10919 }
10920
10921
10922 for b.Controls[0].Op == Op386FlagEQ {
10923 b.Reset(BlockFirst)
10924 b.swapSuccessors()
10925 return true
10926 }
10927
10928
10929 for b.Controls[0].Op == Op386FlagLT_ULT {
10930 b.Reset(BlockFirst)
10931 b.swapSuccessors()
10932 return true
10933 }
10934
10935
10936 for b.Controls[0].Op == Op386FlagLT_UGT {
10937 b.Reset(BlockFirst)
10938 b.swapSuccessors()
10939 return true
10940 }
10941
10942
10943 for b.Controls[0].Op == Op386FlagGT_ULT {
10944 b.Reset(BlockFirst)
10945 return true
10946 }
10947
10948
10949 for b.Controls[0].Op == Op386FlagGT_UGT {
10950 b.Reset(BlockFirst)
10951 return true
10952 }
10953 case BlockIf:
10954
10955
10956 for b.Controls[0].Op == Op386SETL {
10957 v_0 := b.Controls[0]
10958 cmp := v_0.Args[0]
10959 b.resetWithControl(Block386LT, cmp)
10960 return true
10961 }
10962
10963
10964 for b.Controls[0].Op == Op386SETLE {
10965 v_0 := b.Controls[0]
10966 cmp := v_0.Args[0]
10967 b.resetWithControl(Block386LE, cmp)
10968 return true
10969 }
10970
10971
10972 for b.Controls[0].Op == Op386SETG {
10973 v_0 := b.Controls[0]
10974 cmp := v_0.Args[0]
10975 b.resetWithControl(Block386GT, cmp)
10976 return true
10977 }
10978
10979
10980 for b.Controls[0].Op == Op386SETGE {
10981 v_0 := b.Controls[0]
10982 cmp := v_0.Args[0]
10983 b.resetWithControl(Block386GE, cmp)
10984 return true
10985 }
10986
10987
10988 for b.Controls[0].Op == Op386SETEQ {
10989 v_0 := b.Controls[0]
10990 cmp := v_0.Args[0]
10991 b.resetWithControl(Block386EQ, cmp)
10992 return true
10993 }
10994
10995
10996 for b.Controls[0].Op == Op386SETNE {
10997 v_0 := b.Controls[0]
10998 cmp := v_0.Args[0]
10999 b.resetWithControl(Block386NE, cmp)
11000 return true
11001 }
11002
11003
11004 for b.Controls[0].Op == Op386SETB {
11005 v_0 := b.Controls[0]
11006 cmp := v_0.Args[0]
11007 b.resetWithControl(Block386ULT, cmp)
11008 return true
11009 }
11010
11011
11012 for b.Controls[0].Op == Op386SETBE {
11013 v_0 := b.Controls[0]
11014 cmp := v_0.Args[0]
11015 b.resetWithControl(Block386ULE, cmp)
11016 return true
11017 }
11018
11019
11020 for b.Controls[0].Op == Op386SETA {
11021 v_0 := b.Controls[0]
11022 cmp := v_0.Args[0]
11023 b.resetWithControl(Block386UGT, cmp)
11024 return true
11025 }
11026
11027
11028 for b.Controls[0].Op == Op386SETAE {
11029 v_0 := b.Controls[0]
11030 cmp := v_0.Args[0]
11031 b.resetWithControl(Block386UGE, cmp)
11032 return true
11033 }
11034
11035
11036 for b.Controls[0].Op == Op386SETO {
11037 v_0 := b.Controls[0]
11038 cmp := v_0.Args[0]
11039 b.resetWithControl(Block386OS, cmp)
11040 return true
11041 }
11042
11043
11044 for b.Controls[0].Op == Op386SETGF {
11045 v_0 := b.Controls[0]
11046 cmp := v_0.Args[0]
11047 b.resetWithControl(Block386UGT, cmp)
11048 return true
11049 }
11050
11051
11052 for b.Controls[0].Op == Op386SETGEF {
11053 v_0 := b.Controls[0]
11054 cmp := v_0.Args[0]
11055 b.resetWithControl(Block386UGE, cmp)
11056 return true
11057 }
11058
11059
11060 for b.Controls[0].Op == Op386SETEQF {
11061 v_0 := b.Controls[0]
11062 cmp := v_0.Args[0]
11063 b.resetWithControl(Block386EQF, cmp)
11064 return true
11065 }
11066
11067
11068 for b.Controls[0].Op == Op386SETNEF {
11069 v_0 := b.Controls[0]
11070 cmp := v_0.Args[0]
11071 b.resetWithControl(Block386NEF, cmp)
11072 return true
11073 }
11074
11075
11076 for {
11077 cond := b.Controls[0]
11078 v0 := b.NewValue0(cond.Pos, Op386TESTB, types.TypeFlags)
11079 v0.AddArg2(cond, cond)
11080 b.resetWithControl(Block386NE, v0)
11081 return true
11082 }
11083 case Block386LE:
11084
11085
11086 for b.Controls[0].Op == Op386InvertFlags {
11087 v_0 := b.Controls[0]
11088 cmp := v_0.Args[0]
11089 b.resetWithControl(Block386GE, cmp)
11090 return true
11091 }
11092
11093
11094 for b.Controls[0].Op == Op386FlagEQ {
11095 b.Reset(BlockFirst)
11096 return true
11097 }
11098
11099
11100 for b.Controls[0].Op == Op386FlagLT_ULT {
11101 b.Reset(BlockFirst)
11102 return true
11103 }
11104
11105
11106 for b.Controls[0].Op == Op386FlagLT_UGT {
11107 b.Reset(BlockFirst)
11108 return true
11109 }
11110
11111
11112 for b.Controls[0].Op == Op386FlagGT_ULT {
11113 b.Reset(BlockFirst)
11114 b.swapSuccessors()
11115 return true
11116 }
11117
11118
11119 for b.Controls[0].Op == Op386FlagGT_UGT {
11120 b.Reset(BlockFirst)
11121 b.swapSuccessors()
11122 return true
11123 }
11124 case Block386LT:
11125
11126
11127 for b.Controls[0].Op == Op386InvertFlags {
11128 v_0 := b.Controls[0]
11129 cmp := v_0.Args[0]
11130 b.resetWithControl(Block386GT, cmp)
11131 return true
11132 }
11133
11134
11135 for b.Controls[0].Op == Op386FlagEQ {
11136 b.Reset(BlockFirst)
11137 b.swapSuccessors()
11138 return true
11139 }
11140
11141
11142 for b.Controls[0].Op == Op386FlagLT_ULT {
11143 b.Reset(BlockFirst)
11144 return true
11145 }
11146
11147
11148 for b.Controls[0].Op == Op386FlagLT_UGT {
11149 b.Reset(BlockFirst)
11150 return true
11151 }
11152
11153
11154 for b.Controls[0].Op == Op386FlagGT_ULT {
11155 b.Reset(BlockFirst)
11156 b.swapSuccessors()
11157 return true
11158 }
11159
11160
11161 for b.Controls[0].Op == Op386FlagGT_UGT {
11162 b.Reset(BlockFirst)
11163 b.swapSuccessors()
11164 return true
11165 }
11166 case Block386NE:
11167
11168
11169 for b.Controls[0].Op == Op386TESTB {
11170 v_0 := b.Controls[0]
11171 _ = v_0.Args[1]
11172 v_0_0 := v_0.Args[0]
11173 if v_0_0.Op != Op386SETL {
11174 break
11175 }
11176 cmp := v_0_0.Args[0]
11177 v_0_1 := v_0.Args[1]
11178 if v_0_1.Op != Op386SETL || cmp != v_0_1.Args[0] {
11179 break
11180 }
11181 b.resetWithControl(Block386LT, cmp)
11182 return true
11183 }
11184
11185
11186 for b.Controls[0].Op == Op386TESTB {
11187 v_0 := b.Controls[0]
11188 _ = v_0.Args[1]
11189 v_0_0 := v_0.Args[0]
11190 if v_0_0.Op != Op386SETLE {
11191 break
11192 }
11193 cmp := v_0_0.Args[0]
11194 v_0_1 := v_0.Args[1]
11195 if v_0_1.Op != Op386SETLE || cmp != v_0_1.Args[0] {
11196 break
11197 }
11198 b.resetWithControl(Block386LE, cmp)
11199 return true
11200 }
11201
11202
11203 for b.Controls[0].Op == Op386TESTB {
11204 v_0 := b.Controls[0]
11205 _ = v_0.Args[1]
11206 v_0_0 := v_0.Args[0]
11207 if v_0_0.Op != Op386SETG {
11208 break
11209 }
11210 cmp := v_0_0.Args[0]
11211 v_0_1 := v_0.Args[1]
11212 if v_0_1.Op != Op386SETG || cmp != v_0_1.Args[0] {
11213 break
11214 }
11215 b.resetWithControl(Block386GT, cmp)
11216 return true
11217 }
11218
11219
11220 for b.Controls[0].Op == Op386TESTB {
11221 v_0 := b.Controls[0]
11222 _ = v_0.Args[1]
11223 v_0_0 := v_0.Args[0]
11224 if v_0_0.Op != Op386SETGE {
11225 break
11226 }
11227 cmp := v_0_0.Args[0]
11228 v_0_1 := v_0.Args[1]
11229 if v_0_1.Op != Op386SETGE || cmp != v_0_1.Args[0] {
11230 break
11231 }
11232 b.resetWithControl(Block386GE, cmp)
11233 return true
11234 }
11235
11236
11237 for b.Controls[0].Op == Op386TESTB {
11238 v_0 := b.Controls[0]
11239 _ = v_0.Args[1]
11240 v_0_0 := v_0.Args[0]
11241 if v_0_0.Op != Op386SETEQ {
11242 break
11243 }
11244 cmp := v_0_0.Args[0]
11245 v_0_1 := v_0.Args[1]
11246 if v_0_1.Op != Op386SETEQ || cmp != v_0_1.Args[0] {
11247 break
11248 }
11249 b.resetWithControl(Block386EQ, cmp)
11250 return true
11251 }
11252
11253
11254 for b.Controls[0].Op == Op386TESTB {
11255 v_0 := b.Controls[0]
11256 _ = v_0.Args[1]
11257 v_0_0 := v_0.Args[0]
11258 if v_0_0.Op != Op386SETNE {
11259 break
11260 }
11261 cmp := v_0_0.Args[0]
11262 v_0_1 := v_0.Args[1]
11263 if v_0_1.Op != Op386SETNE || cmp != v_0_1.Args[0] {
11264 break
11265 }
11266 b.resetWithControl(Block386NE, cmp)
11267 return true
11268 }
11269
11270
11271 for b.Controls[0].Op == Op386TESTB {
11272 v_0 := b.Controls[0]
11273 _ = v_0.Args[1]
11274 v_0_0 := v_0.Args[0]
11275 if v_0_0.Op != Op386SETB {
11276 break
11277 }
11278 cmp := v_0_0.Args[0]
11279 v_0_1 := v_0.Args[1]
11280 if v_0_1.Op != Op386SETB || cmp != v_0_1.Args[0] {
11281 break
11282 }
11283 b.resetWithControl(Block386ULT, cmp)
11284 return true
11285 }
11286
11287
11288 for b.Controls[0].Op == Op386TESTB {
11289 v_0 := b.Controls[0]
11290 _ = v_0.Args[1]
11291 v_0_0 := v_0.Args[0]
11292 if v_0_0.Op != Op386SETBE {
11293 break
11294 }
11295 cmp := v_0_0.Args[0]
11296 v_0_1 := v_0.Args[1]
11297 if v_0_1.Op != Op386SETBE || cmp != v_0_1.Args[0] {
11298 break
11299 }
11300 b.resetWithControl(Block386ULE, cmp)
11301 return true
11302 }
11303
11304
11305 for b.Controls[0].Op == Op386TESTB {
11306 v_0 := b.Controls[0]
11307 _ = v_0.Args[1]
11308 v_0_0 := v_0.Args[0]
11309 if v_0_0.Op != Op386SETA {
11310 break
11311 }
11312 cmp := v_0_0.Args[0]
11313 v_0_1 := v_0.Args[1]
11314 if v_0_1.Op != Op386SETA || cmp != v_0_1.Args[0] {
11315 break
11316 }
11317 b.resetWithControl(Block386UGT, cmp)
11318 return true
11319 }
11320
11321
11322 for b.Controls[0].Op == Op386TESTB {
11323 v_0 := b.Controls[0]
11324 _ = v_0.Args[1]
11325 v_0_0 := v_0.Args[0]
11326 if v_0_0.Op != Op386SETAE {
11327 break
11328 }
11329 cmp := v_0_0.Args[0]
11330 v_0_1 := v_0.Args[1]
11331 if v_0_1.Op != Op386SETAE || cmp != v_0_1.Args[0] {
11332 break
11333 }
11334 b.resetWithControl(Block386UGE, cmp)
11335 return true
11336 }
11337
11338
11339 for b.Controls[0].Op == Op386TESTB {
11340 v_0 := b.Controls[0]
11341 _ = v_0.Args[1]
11342 v_0_0 := v_0.Args[0]
11343 if v_0_0.Op != Op386SETO {
11344 break
11345 }
11346 cmp := v_0_0.Args[0]
11347 v_0_1 := v_0.Args[1]
11348 if v_0_1.Op != Op386SETO || cmp != v_0_1.Args[0] {
11349 break
11350 }
11351 b.resetWithControl(Block386OS, cmp)
11352 return true
11353 }
11354
11355
11356 for b.Controls[0].Op == Op386TESTB {
11357 v_0 := b.Controls[0]
11358 _ = v_0.Args[1]
11359 v_0_0 := v_0.Args[0]
11360 if v_0_0.Op != Op386SETGF {
11361 break
11362 }
11363 cmp := v_0_0.Args[0]
11364 v_0_1 := v_0.Args[1]
11365 if v_0_1.Op != Op386SETGF || cmp != v_0_1.Args[0] {
11366 break
11367 }
11368 b.resetWithControl(Block386UGT, cmp)
11369 return true
11370 }
11371
11372
11373 for b.Controls[0].Op == Op386TESTB {
11374 v_0 := b.Controls[0]
11375 _ = v_0.Args[1]
11376 v_0_0 := v_0.Args[0]
11377 if v_0_0.Op != Op386SETGEF {
11378 break
11379 }
11380 cmp := v_0_0.Args[0]
11381 v_0_1 := v_0.Args[1]
11382 if v_0_1.Op != Op386SETGEF || cmp != v_0_1.Args[0] {
11383 break
11384 }
11385 b.resetWithControl(Block386UGE, cmp)
11386 return true
11387 }
11388
11389
11390 for b.Controls[0].Op == Op386TESTB {
11391 v_0 := b.Controls[0]
11392 _ = v_0.Args[1]
11393 v_0_0 := v_0.Args[0]
11394 if v_0_0.Op != Op386SETEQF {
11395 break
11396 }
11397 cmp := v_0_0.Args[0]
11398 v_0_1 := v_0.Args[1]
11399 if v_0_1.Op != Op386SETEQF || cmp != v_0_1.Args[0] {
11400 break
11401 }
11402 b.resetWithControl(Block386EQF, cmp)
11403 return true
11404 }
11405
11406
11407 for b.Controls[0].Op == Op386TESTB {
11408 v_0 := b.Controls[0]
11409 _ = v_0.Args[1]
11410 v_0_0 := v_0.Args[0]
11411 if v_0_0.Op != Op386SETNEF {
11412 break
11413 }
11414 cmp := v_0_0.Args[0]
11415 v_0_1 := v_0.Args[1]
11416 if v_0_1.Op != Op386SETNEF || cmp != v_0_1.Args[0] {
11417 break
11418 }
11419 b.resetWithControl(Block386NEF, cmp)
11420 return true
11421 }
11422
11423
11424 for b.Controls[0].Op == Op386InvertFlags {
11425 v_0 := b.Controls[0]
11426 cmp := v_0.Args[0]
11427 b.resetWithControl(Block386NE, cmp)
11428 return true
11429 }
11430
11431
11432 for b.Controls[0].Op == Op386FlagEQ {
11433 b.Reset(BlockFirst)
11434 b.swapSuccessors()
11435 return true
11436 }
11437
11438
11439 for b.Controls[0].Op == Op386FlagLT_ULT {
11440 b.Reset(BlockFirst)
11441 return true
11442 }
11443
11444
11445 for b.Controls[0].Op == Op386FlagLT_UGT {
11446 b.Reset(BlockFirst)
11447 return true
11448 }
11449
11450
11451 for b.Controls[0].Op == Op386FlagGT_ULT {
11452 b.Reset(BlockFirst)
11453 return true
11454 }
11455
11456
11457 for b.Controls[0].Op == Op386FlagGT_UGT {
11458 b.Reset(BlockFirst)
11459 return true
11460 }
11461 case Block386UGE:
11462
11463
11464 for b.Controls[0].Op == Op386InvertFlags {
11465 v_0 := b.Controls[0]
11466 cmp := v_0.Args[0]
11467 b.resetWithControl(Block386ULE, cmp)
11468 return true
11469 }
11470
11471
11472 for b.Controls[0].Op == Op386FlagEQ {
11473 b.Reset(BlockFirst)
11474 return true
11475 }
11476
11477
11478 for b.Controls[0].Op == Op386FlagLT_ULT {
11479 b.Reset(BlockFirst)
11480 b.swapSuccessors()
11481 return true
11482 }
11483
11484
11485 for b.Controls[0].Op == Op386FlagLT_UGT {
11486 b.Reset(BlockFirst)
11487 return true
11488 }
11489
11490
11491 for b.Controls[0].Op == Op386FlagGT_ULT {
11492 b.Reset(BlockFirst)
11493 b.swapSuccessors()
11494 return true
11495 }
11496
11497
11498 for b.Controls[0].Op == Op386FlagGT_UGT {
11499 b.Reset(BlockFirst)
11500 return true
11501 }
11502 case Block386UGT:
11503
11504
11505 for b.Controls[0].Op == Op386InvertFlags {
11506 v_0 := b.Controls[0]
11507 cmp := v_0.Args[0]
11508 b.resetWithControl(Block386ULT, cmp)
11509 return true
11510 }
11511
11512
11513 for b.Controls[0].Op == Op386FlagEQ {
11514 b.Reset(BlockFirst)
11515 b.swapSuccessors()
11516 return true
11517 }
11518
11519
11520 for b.Controls[0].Op == Op386FlagLT_ULT {
11521 b.Reset(BlockFirst)
11522 b.swapSuccessors()
11523 return true
11524 }
11525
11526
11527 for b.Controls[0].Op == Op386FlagLT_UGT {
11528 b.Reset(BlockFirst)
11529 return true
11530 }
11531
11532
11533 for b.Controls[0].Op == Op386FlagGT_ULT {
11534 b.Reset(BlockFirst)
11535 b.swapSuccessors()
11536 return true
11537 }
11538
11539
11540 for b.Controls[0].Op == Op386FlagGT_UGT {
11541 b.Reset(BlockFirst)
11542 return true
11543 }
11544 case Block386ULE:
11545
11546
11547 for b.Controls[0].Op == Op386InvertFlags {
11548 v_0 := b.Controls[0]
11549 cmp := v_0.Args[0]
11550 b.resetWithControl(Block386UGE, cmp)
11551 return true
11552 }
11553
11554
11555 for b.Controls[0].Op == Op386FlagEQ {
11556 b.Reset(BlockFirst)
11557 return true
11558 }
11559
11560
11561 for b.Controls[0].Op == Op386FlagLT_ULT {
11562 b.Reset(BlockFirst)
11563 return true
11564 }
11565
11566
11567 for b.Controls[0].Op == Op386FlagLT_UGT {
11568 b.Reset(BlockFirst)
11569 b.swapSuccessors()
11570 return true
11571 }
11572
11573
11574 for b.Controls[0].Op == Op386FlagGT_ULT {
11575 b.Reset(BlockFirst)
11576 return true
11577 }
11578
11579
11580 for b.Controls[0].Op == Op386FlagGT_UGT {
11581 b.Reset(BlockFirst)
11582 b.swapSuccessors()
11583 return true
11584 }
11585 case Block386ULT:
11586
11587
11588 for b.Controls[0].Op == Op386InvertFlags {
11589 v_0 := b.Controls[0]
11590 cmp := v_0.Args[0]
11591 b.resetWithControl(Block386UGT, cmp)
11592 return true
11593 }
11594
11595
11596 for b.Controls[0].Op == Op386FlagEQ {
11597 b.Reset(BlockFirst)
11598 b.swapSuccessors()
11599 return true
11600 }
11601
11602
11603 for b.Controls[0].Op == Op386FlagLT_ULT {
11604 b.Reset(BlockFirst)
11605 return true
11606 }
11607
11608
11609 for b.Controls[0].Op == Op386FlagLT_UGT {
11610 b.Reset(BlockFirst)
11611 b.swapSuccessors()
11612 return true
11613 }
11614
11615
11616 for b.Controls[0].Op == Op386FlagGT_ULT {
11617 b.Reset(BlockFirst)
11618 return true
11619 }
11620
11621
11622 for b.Controls[0].Op == Op386FlagGT_UGT {
11623 b.Reset(BlockFirst)
11624 b.swapSuccessors()
11625 return true
11626 }
11627 }
11628 return false
11629 }
11630
View as plain text