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