1
2
3 package ssa
4
5 func rewriteValueAMD64splitload(v *Value) bool {
6 switch v.Op {
7 case OpAMD64CMPBconstload:
8 return rewriteValueAMD64splitload_OpAMD64CMPBconstload(v)
9 case OpAMD64CMPBconstloadidx1:
10 return rewriteValueAMD64splitload_OpAMD64CMPBconstloadidx1(v)
11 case OpAMD64CMPBload:
12 return rewriteValueAMD64splitload_OpAMD64CMPBload(v)
13 case OpAMD64CMPBloadidx1:
14 return rewriteValueAMD64splitload_OpAMD64CMPBloadidx1(v)
15 case OpAMD64CMPLconstload:
16 return rewriteValueAMD64splitload_OpAMD64CMPLconstload(v)
17 case OpAMD64CMPLconstloadidx1:
18 return rewriteValueAMD64splitload_OpAMD64CMPLconstloadidx1(v)
19 case OpAMD64CMPLconstloadidx4:
20 return rewriteValueAMD64splitload_OpAMD64CMPLconstloadidx4(v)
21 case OpAMD64CMPLload:
22 return rewriteValueAMD64splitload_OpAMD64CMPLload(v)
23 case OpAMD64CMPLloadidx1:
24 return rewriteValueAMD64splitload_OpAMD64CMPLloadidx1(v)
25 case OpAMD64CMPLloadidx4:
26 return rewriteValueAMD64splitload_OpAMD64CMPLloadidx4(v)
27 case OpAMD64CMPQconstload:
28 return rewriteValueAMD64splitload_OpAMD64CMPQconstload(v)
29 case OpAMD64CMPQconstloadidx1:
30 return rewriteValueAMD64splitload_OpAMD64CMPQconstloadidx1(v)
31 case OpAMD64CMPQconstloadidx8:
32 return rewriteValueAMD64splitload_OpAMD64CMPQconstloadidx8(v)
33 case OpAMD64CMPQload:
34 return rewriteValueAMD64splitload_OpAMD64CMPQload(v)
35 case OpAMD64CMPQloadidx1:
36 return rewriteValueAMD64splitload_OpAMD64CMPQloadidx1(v)
37 case OpAMD64CMPQloadidx8:
38 return rewriteValueAMD64splitload_OpAMD64CMPQloadidx8(v)
39 case OpAMD64CMPWconstload:
40 return rewriteValueAMD64splitload_OpAMD64CMPWconstload(v)
41 case OpAMD64CMPWconstloadidx1:
42 return rewriteValueAMD64splitload_OpAMD64CMPWconstloadidx1(v)
43 case OpAMD64CMPWconstloadidx2:
44 return rewriteValueAMD64splitload_OpAMD64CMPWconstloadidx2(v)
45 case OpAMD64CMPWload:
46 return rewriteValueAMD64splitload_OpAMD64CMPWload(v)
47 case OpAMD64CMPWloadidx1:
48 return rewriteValueAMD64splitload_OpAMD64CMPWloadidx1(v)
49 case OpAMD64CMPWloadidx2:
50 return rewriteValueAMD64splitload_OpAMD64CMPWloadidx2(v)
51 }
52 return false
53 }
54 func rewriteValueAMD64splitload_OpAMD64CMPBconstload(v *Value) bool {
55 v_1 := v.Args[1]
56 v_0 := v.Args[0]
57 b := v.Block
58 typ := &b.Func.Config.Types
59
60
61
62 for {
63 vo := auxIntToValAndOff(v.AuxInt)
64 sym := auxToSym(v.Aux)
65 ptr := v_0
66 mem := v_1
67 if !(vo.Val() == 0) {
68 break
69 }
70 v.reset(OpAMD64TESTB)
71 x := b.NewValue0(v.Pos, OpAMD64MOVBload, typ.UInt8)
72 x.AuxInt = int32ToAuxInt(vo.Off())
73 x.Aux = symToAux(sym)
74 x.AddArg2(ptr, mem)
75 v.AddArg2(x, x)
76 return true
77 }
78
79
80
81 for {
82 vo := auxIntToValAndOff(v.AuxInt)
83 sym := auxToSym(v.Aux)
84 ptr := v_0
85 mem := v_1
86 if !(vo.Val() != 0) {
87 break
88 }
89 v.reset(OpAMD64CMPBconst)
90 v.AuxInt = int8ToAuxInt(vo.Val8())
91 v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, typ.UInt8)
92 v0.AuxInt = int32ToAuxInt(vo.Off())
93 v0.Aux = symToAux(sym)
94 v0.AddArg2(ptr, mem)
95 v.AddArg(v0)
96 return true
97 }
98 return false
99 }
100 func rewriteValueAMD64splitload_OpAMD64CMPBconstloadidx1(v *Value) bool {
101 v_2 := v.Args[2]
102 v_1 := v.Args[1]
103 v_0 := v.Args[0]
104 b := v.Block
105 typ := &b.Func.Config.Types
106
107
108
109 for {
110 vo := auxIntToValAndOff(v.AuxInt)
111 sym := auxToSym(v.Aux)
112 ptr := v_0
113 idx := v_1
114 mem := v_2
115 if !(vo.Val() == 0) {
116 break
117 }
118 v.reset(OpAMD64TESTB)
119 x := b.NewValue0(v.Pos, OpAMD64MOVBloadidx1, typ.UInt8)
120 x.AuxInt = int32ToAuxInt(vo.Off())
121 x.Aux = symToAux(sym)
122 x.AddArg3(ptr, idx, mem)
123 v.AddArg2(x, x)
124 return true
125 }
126
127
128
129 for {
130 vo := auxIntToValAndOff(v.AuxInt)
131 sym := auxToSym(v.Aux)
132 ptr := v_0
133 idx := v_1
134 mem := v_2
135 if !(vo.Val() != 0) {
136 break
137 }
138 v.reset(OpAMD64CMPBconst)
139 v.AuxInt = int8ToAuxInt(vo.Val8())
140 v0 := b.NewValue0(v.Pos, OpAMD64MOVBloadidx1, typ.UInt8)
141 v0.AuxInt = int32ToAuxInt(vo.Off())
142 v0.Aux = symToAux(sym)
143 v0.AddArg3(ptr, idx, mem)
144 v.AddArg(v0)
145 return true
146 }
147 return false
148 }
149 func rewriteValueAMD64splitload_OpAMD64CMPBload(v *Value) bool {
150 v_2 := v.Args[2]
151 v_1 := v.Args[1]
152 v_0 := v.Args[0]
153 b := v.Block
154
155
156 for {
157 off := auxIntToInt32(v.AuxInt)
158 sym := auxToSym(v.Aux)
159 ptr := v_0
160 x := v_1
161 mem := v_2
162 v.reset(OpAMD64CMPB)
163 v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, x.Type)
164 v0.AuxInt = int32ToAuxInt(off)
165 v0.Aux = symToAux(sym)
166 v0.AddArg2(ptr, mem)
167 v.AddArg2(v0, x)
168 return true
169 }
170 }
171 func rewriteValueAMD64splitload_OpAMD64CMPBloadidx1(v *Value) bool {
172 v_3 := v.Args[3]
173 v_2 := v.Args[2]
174 v_1 := v.Args[1]
175 v_0 := v.Args[0]
176 b := v.Block
177
178
179 for {
180 off := auxIntToInt32(v.AuxInt)
181 sym := auxToSym(v.Aux)
182 ptr := v_0
183 idx := v_1
184 x := v_2
185 mem := v_3
186 v.reset(OpAMD64CMPB)
187 v0 := b.NewValue0(v.Pos, OpAMD64MOVBloadidx1, x.Type)
188 v0.AuxInt = int32ToAuxInt(off)
189 v0.Aux = symToAux(sym)
190 v0.AddArg3(ptr, idx, mem)
191 v.AddArg2(v0, x)
192 return true
193 }
194 }
195 func rewriteValueAMD64splitload_OpAMD64CMPLconstload(v *Value) bool {
196 v_1 := v.Args[1]
197 v_0 := v.Args[0]
198 b := v.Block
199 typ := &b.Func.Config.Types
200
201
202
203 for {
204 vo := auxIntToValAndOff(v.AuxInt)
205 sym := auxToSym(v.Aux)
206 ptr := v_0
207 mem := v_1
208 if !(vo.Val() == 0) {
209 break
210 }
211 v.reset(OpAMD64TESTL)
212 x := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32)
213 x.AuxInt = int32ToAuxInt(vo.Off())
214 x.Aux = symToAux(sym)
215 x.AddArg2(ptr, mem)
216 v.AddArg2(x, x)
217 return true
218 }
219
220
221
222 for {
223 vo := auxIntToValAndOff(v.AuxInt)
224 sym := auxToSym(v.Aux)
225 ptr := v_0
226 mem := v_1
227 if !(vo.Val() != 0) {
228 break
229 }
230 v.reset(OpAMD64CMPLconst)
231 v.AuxInt = int32ToAuxInt(vo.Val())
232 v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32)
233 v0.AuxInt = int32ToAuxInt(vo.Off())
234 v0.Aux = symToAux(sym)
235 v0.AddArg2(ptr, mem)
236 v.AddArg(v0)
237 return true
238 }
239 return false
240 }
241 func rewriteValueAMD64splitload_OpAMD64CMPLconstloadidx1(v *Value) bool {
242 v_2 := v.Args[2]
243 v_1 := v.Args[1]
244 v_0 := v.Args[0]
245 b := v.Block
246 typ := &b.Func.Config.Types
247
248
249
250 for {
251 vo := auxIntToValAndOff(v.AuxInt)
252 sym := auxToSym(v.Aux)
253 ptr := v_0
254 idx := v_1
255 mem := v_2
256 if !(vo.Val() == 0) {
257 break
258 }
259 v.reset(OpAMD64TESTL)
260 x := b.NewValue0(v.Pos, OpAMD64MOVLloadidx1, typ.UInt32)
261 x.AuxInt = int32ToAuxInt(vo.Off())
262 x.Aux = symToAux(sym)
263 x.AddArg3(ptr, idx, mem)
264 v.AddArg2(x, x)
265 return true
266 }
267
268
269
270 for {
271 vo := auxIntToValAndOff(v.AuxInt)
272 sym := auxToSym(v.Aux)
273 ptr := v_0
274 idx := v_1
275 mem := v_2
276 if !(vo.Val() != 0) {
277 break
278 }
279 v.reset(OpAMD64CMPLconst)
280 v.AuxInt = int32ToAuxInt(vo.Val())
281 v0 := b.NewValue0(v.Pos, OpAMD64MOVLloadidx1, typ.UInt32)
282 v0.AuxInt = int32ToAuxInt(vo.Off())
283 v0.Aux = symToAux(sym)
284 v0.AddArg3(ptr, idx, mem)
285 v.AddArg(v0)
286 return true
287 }
288 return false
289 }
290 func rewriteValueAMD64splitload_OpAMD64CMPLconstloadidx4(v *Value) bool {
291 v_2 := v.Args[2]
292 v_1 := v.Args[1]
293 v_0 := v.Args[0]
294 b := v.Block
295 typ := &b.Func.Config.Types
296
297
298
299 for {
300 vo := auxIntToValAndOff(v.AuxInt)
301 sym := auxToSym(v.Aux)
302 ptr := v_0
303 idx := v_1
304 mem := v_2
305 if !(vo.Val() == 0) {
306 break
307 }
308 v.reset(OpAMD64TESTL)
309 x := b.NewValue0(v.Pos, OpAMD64MOVLloadidx4, typ.UInt32)
310 x.AuxInt = int32ToAuxInt(vo.Off())
311 x.Aux = symToAux(sym)
312 x.AddArg3(ptr, idx, mem)
313 v.AddArg2(x, x)
314 return true
315 }
316
317
318
319 for {
320 vo := auxIntToValAndOff(v.AuxInt)
321 sym := auxToSym(v.Aux)
322 ptr := v_0
323 idx := v_1
324 mem := v_2
325 if !(vo.Val() != 0) {
326 break
327 }
328 v.reset(OpAMD64CMPLconst)
329 v.AuxInt = int32ToAuxInt(vo.Val())
330 v0 := b.NewValue0(v.Pos, OpAMD64MOVLloadidx4, typ.UInt32)
331 v0.AuxInt = int32ToAuxInt(vo.Off())
332 v0.Aux = symToAux(sym)
333 v0.AddArg3(ptr, idx, mem)
334 v.AddArg(v0)
335 return true
336 }
337 return false
338 }
339 func rewriteValueAMD64splitload_OpAMD64CMPLload(v *Value) bool {
340 v_2 := v.Args[2]
341 v_1 := v.Args[1]
342 v_0 := v.Args[0]
343 b := v.Block
344
345
346 for {
347 off := auxIntToInt32(v.AuxInt)
348 sym := auxToSym(v.Aux)
349 ptr := v_0
350 x := v_1
351 mem := v_2
352 v.reset(OpAMD64CMPL)
353 v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, x.Type)
354 v0.AuxInt = int32ToAuxInt(off)
355 v0.Aux = symToAux(sym)
356 v0.AddArg2(ptr, mem)
357 v.AddArg2(v0, x)
358 return true
359 }
360 }
361 func rewriteValueAMD64splitload_OpAMD64CMPLloadidx1(v *Value) bool {
362 v_3 := v.Args[3]
363 v_2 := v.Args[2]
364 v_1 := v.Args[1]
365 v_0 := v.Args[0]
366 b := v.Block
367
368
369 for {
370 off := auxIntToInt32(v.AuxInt)
371 sym := auxToSym(v.Aux)
372 ptr := v_0
373 idx := v_1
374 x := v_2
375 mem := v_3
376 v.reset(OpAMD64CMPL)
377 v0 := b.NewValue0(v.Pos, OpAMD64MOVLloadidx1, x.Type)
378 v0.AuxInt = int32ToAuxInt(off)
379 v0.Aux = symToAux(sym)
380 v0.AddArg3(ptr, idx, mem)
381 v.AddArg2(v0, x)
382 return true
383 }
384 }
385 func rewriteValueAMD64splitload_OpAMD64CMPLloadidx4(v *Value) bool {
386 v_3 := v.Args[3]
387 v_2 := v.Args[2]
388 v_1 := v.Args[1]
389 v_0 := v.Args[0]
390 b := v.Block
391
392
393 for {
394 off := auxIntToInt32(v.AuxInt)
395 sym := auxToSym(v.Aux)
396 ptr := v_0
397 idx := v_1
398 x := v_2
399 mem := v_3
400 v.reset(OpAMD64CMPL)
401 v0 := b.NewValue0(v.Pos, OpAMD64MOVLloadidx4, x.Type)
402 v0.AuxInt = int32ToAuxInt(off)
403 v0.Aux = symToAux(sym)
404 v0.AddArg3(ptr, idx, mem)
405 v.AddArg2(v0, x)
406 return true
407 }
408 }
409 func rewriteValueAMD64splitload_OpAMD64CMPQconstload(v *Value) bool {
410 v_1 := v.Args[1]
411 v_0 := v.Args[0]
412 b := v.Block
413 typ := &b.Func.Config.Types
414
415
416
417 for {
418 vo := auxIntToValAndOff(v.AuxInt)
419 sym := auxToSym(v.Aux)
420 ptr := v_0
421 mem := v_1
422 if !(vo.Val() == 0) {
423 break
424 }
425 v.reset(OpAMD64TESTQ)
426 x := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64)
427 x.AuxInt = int32ToAuxInt(vo.Off())
428 x.Aux = symToAux(sym)
429 x.AddArg2(ptr, mem)
430 v.AddArg2(x, x)
431 return true
432 }
433
434
435
436 for {
437 vo := auxIntToValAndOff(v.AuxInt)
438 sym := auxToSym(v.Aux)
439 ptr := v_0
440 mem := v_1
441 if !(vo.Val() != 0) {
442 break
443 }
444 v.reset(OpAMD64CMPQconst)
445 v.AuxInt = int32ToAuxInt(vo.Val())
446 v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64)
447 v0.AuxInt = int32ToAuxInt(vo.Off())
448 v0.Aux = symToAux(sym)
449 v0.AddArg2(ptr, mem)
450 v.AddArg(v0)
451 return true
452 }
453 return false
454 }
455 func rewriteValueAMD64splitload_OpAMD64CMPQconstloadidx1(v *Value) bool {
456 v_2 := v.Args[2]
457 v_1 := v.Args[1]
458 v_0 := v.Args[0]
459 b := v.Block
460 typ := &b.Func.Config.Types
461
462
463
464 for {
465 vo := auxIntToValAndOff(v.AuxInt)
466 sym := auxToSym(v.Aux)
467 ptr := v_0
468 idx := v_1
469 mem := v_2
470 if !(vo.Val() == 0) {
471 break
472 }
473 v.reset(OpAMD64TESTQ)
474 x := b.NewValue0(v.Pos, OpAMD64MOVQloadidx1, typ.UInt64)
475 x.AuxInt = int32ToAuxInt(vo.Off())
476 x.Aux = symToAux(sym)
477 x.AddArg3(ptr, idx, mem)
478 v.AddArg2(x, x)
479 return true
480 }
481
482
483
484 for {
485 vo := auxIntToValAndOff(v.AuxInt)
486 sym := auxToSym(v.Aux)
487 ptr := v_0
488 idx := v_1
489 mem := v_2
490 if !(vo.Val() != 0) {
491 break
492 }
493 v.reset(OpAMD64CMPQconst)
494 v.AuxInt = int32ToAuxInt(vo.Val())
495 v0 := b.NewValue0(v.Pos, OpAMD64MOVQloadidx1, typ.UInt64)
496 v0.AuxInt = int32ToAuxInt(vo.Off())
497 v0.Aux = symToAux(sym)
498 v0.AddArg3(ptr, idx, mem)
499 v.AddArg(v0)
500 return true
501 }
502 return false
503 }
504 func rewriteValueAMD64splitload_OpAMD64CMPQconstloadidx8(v *Value) bool {
505 v_2 := v.Args[2]
506 v_1 := v.Args[1]
507 v_0 := v.Args[0]
508 b := v.Block
509 typ := &b.Func.Config.Types
510
511
512
513 for {
514 vo := auxIntToValAndOff(v.AuxInt)
515 sym := auxToSym(v.Aux)
516 ptr := v_0
517 idx := v_1
518 mem := v_2
519 if !(vo.Val() == 0) {
520 break
521 }
522 v.reset(OpAMD64TESTQ)
523 x := b.NewValue0(v.Pos, OpAMD64MOVQloadidx8, typ.UInt64)
524 x.AuxInt = int32ToAuxInt(vo.Off())
525 x.Aux = symToAux(sym)
526 x.AddArg3(ptr, idx, mem)
527 v.AddArg2(x, x)
528 return true
529 }
530
531
532
533 for {
534 vo := auxIntToValAndOff(v.AuxInt)
535 sym := auxToSym(v.Aux)
536 ptr := v_0
537 idx := v_1
538 mem := v_2
539 if !(vo.Val() != 0) {
540 break
541 }
542 v.reset(OpAMD64CMPQconst)
543 v.AuxInt = int32ToAuxInt(vo.Val())
544 v0 := b.NewValue0(v.Pos, OpAMD64MOVQloadidx8, typ.UInt64)
545 v0.AuxInt = int32ToAuxInt(vo.Off())
546 v0.Aux = symToAux(sym)
547 v0.AddArg3(ptr, idx, mem)
548 v.AddArg(v0)
549 return true
550 }
551 return false
552 }
553 func rewriteValueAMD64splitload_OpAMD64CMPQload(v *Value) bool {
554 v_2 := v.Args[2]
555 v_1 := v.Args[1]
556 v_0 := v.Args[0]
557 b := v.Block
558
559
560 for {
561 off := auxIntToInt32(v.AuxInt)
562 sym := auxToSym(v.Aux)
563 ptr := v_0
564 x := v_1
565 mem := v_2
566 v.reset(OpAMD64CMPQ)
567 v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, x.Type)
568 v0.AuxInt = int32ToAuxInt(off)
569 v0.Aux = symToAux(sym)
570 v0.AddArg2(ptr, mem)
571 v.AddArg2(v0, x)
572 return true
573 }
574 }
575 func rewriteValueAMD64splitload_OpAMD64CMPQloadidx1(v *Value) bool {
576 v_3 := v.Args[3]
577 v_2 := v.Args[2]
578 v_1 := v.Args[1]
579 v_0 := v.Args[0]
580 b := v.Block
581
582
583 for {
584 off := auxIntToInt32(v.AuxInt)
585 sym := auxToSym(v.Aux)
586 ptr := v_0
587 idx := v_1
588 x := v_2
589 mem := v_3
590 v.reset(OpAMD64CMPQ)
591 v0 := b.NewValue0(v.Pos, OpAMD64MOVQloadidx1, x.Type)
592 v0.AuxInt = int32ToAuxInt(off)
593 v0.Aux = symToAux(sym)
594 v0.AddArg3(ptr, idx, mem)
595 v.AddArg2(v0, x)
596 return true
597 }
598 }
599 func rewriteValueAMD64splitload_OpAMD64CMPQloadidx8(v *Value) bool {
600 v_3 := v.Args[3]
601 v_2 := v.Args[2]
602 v_1 := v.Args[1]
603 v_0 := v.Args[0]
604 b := v.Block
605
606
607 for {
608 off := auxIntToInt32(v.AuxInt)
609 sym := auxToSym(v.Aux)
610 ptr := v_0
611 idx := v_1
612 x := v_2
613 mem := v_3
614 v.reset(OpAMD64CMPQ)
615 v0 := b.NewValue0(v.Pos, OpAMD64MOVQloadidx8, x.Type)
616 v0.AuxInt = int32ToAuxInt(off)
617 v0.Aux = symToAux(sym)
618 v0.AddArg3(ptr, idx, mem)
619 v.AddArg2(v0, x)
620 return true
621 }
622 }
623 func rewriteValueAMD64splitload_OpAMD64CMPWconstload(v *Value) bool {
624 v_1 := v.Args[1]
625 v_0 := v.Args[0]
626 b := v.Block
627 typ := &b.Func.Config.Types
628
629
630
631 for {
632 vo := auxIntToValAndOff(v.AuxInt)
633 sym := auxToSym(v.Aux)
634 ptr := v_0
635 mem := v_1
636 if !(vo.Val() == 0) {
637 break
638 }
639 v.reset(OpAMD64TESTW)
640 x := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16)
641 x.AuxInt = int32ToAuxInt(vo.Off())
642 x.Aux = symToAux(sym)
643 x.AddArg2(ptr, mem)
644 v.AddArg2(x, x)
645 return true
646 }
647
648
649
650 for {
651 vo := auxIntToValAndOff(v.AuxInt)
652 sym := auxToSym(v.Aux)
653 ptr := v_0
654 mem := v_1
655 if !(vo.Val() != 0) {
656 break
657 }
658 v.reset(OpAMD64CMPWconst)
659 v.AuxInt = int16ToAuxInt(vo.Val16())
660 v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16)
661 v0.AuxInt = int32ToAuxInt(vo.Off())
662 v0.Aux = symToAux(sym)
663 v0.AddArg2(ptr, mem)
664 v.AddArg(v0)
665 return true
666 }
667 return false
668 }
669 func rewriteValueAMD64splitload_OpAMD64CMPWconstloadidx1(v *Value) bool {
670 v_2 := v.Args[2]
671 v_1 := v.Args[1]
672 v_0 := v.Args[0]
673 b := v.Block
674 typ := &b.Func.Config.Types
675
676
677
678 for {
679 vo := auxIntToValAndOff(v.AuxInt)
680 sym := auxToSym(v.Aux)
681 ptr := v_0
682 idx := v_1
683 mem := v_2
684 if !(vo.Val() == 0) {
685 break
686 }
687 v.reset(OpAMD64TESTW)
688 x := b.NewValue0(v.Pos, OpAMD64MOVWloadidx1, typ.UInt16)
689 x.AuxInt = int32ToAuxInt(vo.Off())
690 x.Aux = symToAux(sym)
691 x.AddArg3(ptr, idx, mem)
692 v.AddArg2(x, x)
693 return true
694 }
695
696
697
698 for {
699 vo := auxIntToValAndOff(v.AuxInt)
700 sym := auxToSym(v.Aux)
701 ptr := v_0
702 idx := v_1
703 mem := v_2
704 if !(vo.Val() != 0) {
705 break
706 }
707 v.reset(OpAMD64CMPWconst)
708 v.AuxInt = int16ToAuxInt(vo.Val16())
709 v0 := b.NewValue0(v.Pos, OpAMD64MOVWloadidx1, typ.UInt16)
710 v0.AuxInt = int32ToAuxInt(vo.Off())
711 v0.Aux = symToAux(sym)
712 v0.AddArg3(ptr, idx, mem)
713 v.AddArg(v0)
714 return true
715 }
716 return false
717 }
718 func rewriteValueAMD64splitload_OpAMD64CMPWconstloadidx2(v *Value) bool {
719 v_2 := v.Args[2]
720 v_1 := v.Args[1]
721 v_0 := v.Args[0]
722 b := v.Block
723 typ := &b.Func.Config.Types
724
725
726
727 for {
728 vo := auxIntToValAndOff(v.AuxInt)
729 sym := auxToSym(v.Aux)
730 ptr := v_0
731 idx := v_1
732 mem := v_2
733 if !(vo.Val() == 0) {
734 break
735 }
736 v.reset(OpAMD64TESTW)
737 x := b.NewValue0(v.Pos, OpAMD64MOVWloadidx2, typ.UInt16)
738 x.AuxInt = int32ToAuxInt(vo.Off())
739 x.Aux = symToAux(sym)
740 x.AddArg3(ptr, idx, mem)
741 v.AddArg2(x, x)
742 return true
743 }
744
745
746
747 for {
748 vo := auxIntToValAndOff(v.AuxInt)
749 sym := auxToSym(v.Aux)
750 ptr := v_0
751 idx := v_1
752 mem := v_2
753 if !(vo.Val() != 0) {
754 break
755 }
756 v.reset(OpAMD64CMPWconst)
757 v.AuxInt = int16ToAuxInt(vo.Val16())
758 v0 := b.NewValue0(v.Pos, OpAMD64MOVWloadidx2, typ.UInt16)
759 v0.AuxInt = int32ToAuxInt(vo.Off())
760 v0.Aux = symToAux(sym)
761 v0.AddArg3(ptr, idx, mem)
762 v.AddArg(v0)
763 return true
764 }
765 return false
766 }
767 func rewriteValueAMD64splitload_OpAMD64CMPWload(v *Value) bool {
768 v_2 := v.Args[2]
769 v_1 := v.Args[1]
770 v_0 := v.Args[0]
771 b := v.Block
772
773
774 for {
775 off := auxIntToInt32(v.AuxInt)
776 sym := auxToSym(v.Aux)
777 ptr := v_0
778 x := v_1
779 mem := v_2
780 v.reset(OpAMD64CMPW)
781 v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, x.Type)
782 v0.AuxInt = int32ToAuxInt(off)
783 v0.Aux = symToAux(sym)
784 v0.AddArg2(ptr, mem)
785 v.AddArg2(v0, x)
786 return true
787 }
788 }
789 func rewriteValueAMD64splitload_OpAMD64CMPWloadidx1(v *Value) bool {
790 v_3 := v.Args[3]
791 v_2 := v.Args[2]
792 v_1 := v.Args[1]
793 v_0 := v.Args[0]
794 b := v.Block
795
796
797 for {
798 off := auxIntToInt32(v.AuxInt)
799 sym := auxToSym(v.Aux)
800 ptr := v_0
801 idx := v_1
802 x := v_2
803 mem := v_3
804 v.reset(OpAMD64CMPW)
805 v0 := b.NewValue0(v.Pos, OpAMD64MOVWloadidx1, x.Type)
806 v0.AuxInt = int32ToAuxInt(off)
807 v0.Aux = symToAux(sym)
808 v0.AddArg3(ptr, idx, mem)
809 v.AddArg2(v0, x)
810 return true
811 }
812 }
813 func rewriteValueAMD64splitload_OpAMD64CMPWloadidx2(v *Value) bool {
814 v_3 := v.Args[3]
815 v_2 := v.Args[2]
816 v_1 := v.Args[1]
817 v_0 := v.Args[0]
818 b := v.Block
819
820
821 for {
822 off := auxIntToInt32(v.AuxInt)
823 sym := auxToSym(v.Aux)
824 ptr := v_0
825 idx := v_1
826 x := v_2
827 mem := v_3
828 v.reset(OpAMD64CMPW)
829 v0 := b.NewValue0(v.Pos, OpAMD64MOVWloadidx2, x.Type)
830 v0.AuxInt = int32ToAuxInt(off)
831 v0.Aux = symToAux(sym)
832 v0.AddArg3(ptr, idx, mem)
833 v.AddArg2(v0, x)
834 return true
835 }
836 }
837 func rewriteBlockAMD64splitload(b *Block) bool {
838 return false
839 }
840
View as plain text