1
2
3 package ssa
4
5 import "math"
6 import "cmd/compile/internal/types"
7
8 func rewriteValueWasm(v *Value) bool {
9 switch v.Op {
10 case OpAbs:
11 v.Op = OpWasmF64Abs
12 return true
13 case OpAdd16:
14 v.Op = OpWasmI64Add
15 return true
16 case OpAdd32:
17 v.Op = OpWasmI64Add
18 return true
19 case OpAdd32F:
20 v.Op = OpWasmF32Add
21 return true
22 case OpAdd64:
23 v.Op = OpWasmI64Add
24 return true
25 case OpAdd64F:
26 v.Op = OpWasmF64Add
27 return true
28 case OpAdd8:
29 v.Op = OpWasmI64Add
30 return true
31 case OpAddPtr:
32 v.Op = OpWasmI64Add
33 return true
34 case OpAddr:
35 return rewriteValueWasm_OpAddr(v)
36 case OpAnd16:
37 v.Op = OpWasmI64And
38 return true
39 case OpAnd32:
40 v.Op = OpWasmI64And
41 return true
42 case OpAnd64:
43 v.Op = OpWasmI64And
44 return true
45 case OpAnd8:
46 v.Op = OpWasmI64And
47 return true
48 case OpAndB:
49 v.Op = OpWasmI64And
50 return true
51 case OpAvg64u:
52 return rewriteValueWasm_OpAvg64u(v)
53 case OpBitLen16:
54 return rewriteValueWasm_OpBitLen16(v)
55 case OpBitLen32:
56 return rewriteValueWasm_OpBitLen32(v)
57 case OpBitLen64:
58 return rewriteValueWasm_OpBitLen64(v)
59 case OpBitLen8:
60 return rewriteValueWasm_OpBitLen8(v)
61 case OpCeil:
62 v.Op = OpWasmF64Ceil
63 return true
64 case OpClosureCall:
65 v.Op = OpWasmLoweredClosureCall
66 return true
67 case OpCom16:
68 return rewriteValueWasm_OpCom16(v)
69 case OpCom32:
70 return rewriteValueWasm_OpCom32(v)
71 case OpCom64:
72 return rewriteValueWasm_OpCom64(v)
73 case OpCom8:
74 return rewriteValueWasm_OpCom8(v)
75 case OpCondSelect:
76 v.Op = OpWasmSelect
77 return true
78 case OpConst16:
79 return rewriteValueWasm_OpConst16(v)
80 case OpConst32:
81 return rewriteValueWasm_OpConst32(v)
82 case OpConst32F:
83 v.Op = OpWasmF32Const
84 return true
85 case OpConst64:
86 v.Op = OpWasmI64Const
87 return true
88 case OpConst64F:
89 v.Op = OpWasmF64Const
90 return true
91 case OpConst8:
92 return rewriteValueWasm_OpConst8(v)
93 case OpConstBool:
94 return rewriteValueWasm_OpConstBool(v)
95 case OpConstNil:
96 return rewriteValueWasm_OpConstNil(v)
97 case OpConvert:
98 v.Op = OpWasmLoweredConvert
99 return true
100 case OpCopysign:
101 v.Op = OpWasmF64Copysign
102 return true
103 case OpCtz16:
104 return rewriteValueWasm_OpCtz16(v)
105 case OpCtz16NonZero:
106 v.Op = OpWasmI64Ctz
107 return true
108 case OpCtz32:
109 return rewriteValueWasm_OpCtz32(v)
110 case OpCtz32NonZero:
111 v.Op = OpWasmI64Ctz
112 return true
113 case OpCtz64:
114 v.Op = OpWasmI64Ctz
115 return true
116 case OpCtz64NonZero:
117 v.Op = OpWasmI64Ctz
118 return true
119 case OpCtz8:
120 return rewriteValueWasm_OpCtz8(v)
121 case OpCtz8NonZero:
122 v.Op = OpWasmI64Ctz
123 return true
124 case OpCvt32Fto32:
125 v.Op = OpWasmI64TruncSatF32S
126 return true
127 case OpCvt32Fto32U:
128 v.Op = OpWasmI64TruncSatF32U
129 return true
130 case OpCvt32Fto64:
131 v.Op = OpWasmI64TruncSatF32S
132 return true
133 case OpCvt32Fto64F:
134 v.Op = OpWasmF64PromoteF32
135 return true
136 case OpCvt32Fto64U:
137 v.Op = OpWasmI64TruncSatF32U
138 return true
139 case OpCvt32Uto32F:
140 return rewriteValueWasm_OpCvt32Uto32F(v)
141 case OpCvt32Uto64F:
142 return rewriteValueWasm_OpCvt32Uto64F(v)
143 case OpCvt32to32F:
144 return rewriteValueWasm_OpCvt32to32F(v)
145 case OpCvt32to64F:
146 return rewriteValueWasm_OpCvt32to64F(v)
147 case OpCvt64Fto32:
148 v.Op = OpWasmI64TruncSatF64S
149 return true
150 case OpCvt64Fto32F:
151 v.Op = OpWasmF32DemoteF64
152 return true
153 case OpCvt64Fto32U:
154 v.Op = OpWasmI64TruncSatF64U
155 return true
156 case OpCvt64Fto64:
157 v.Op = OpWasmI64TruncSatF64S
158 return true
159 case OpCvt64Fto64U:
160 v.Op = OpWasmI64TruncSatF64U
161 return true
162 case OpCvt64Uto32F:
163 v.Op = OpWasmF32ConvertI64U
164 return true
165 case OpCvt64Uto64F:
166 v.Op = OpWasmF64ConvertI64U
167 return true
168 case OpCvt64to32F:
169 v.Op = OpWasmF32ConvertI64S
170 return true
171 case OpCvt64to64F:
172 v.Op = OpWasmF64ConvertI64S
173 return true
174 case OpCvtBoolToUint8:
175 v.Op = OpCopy
176 return true
177 case OpDiv16:
178 return rewriteValueWasm_OpDiv16(v)
179 case OpDiv16u:
180 return rewriteValueWasm_OpDiv16u(v)
181 case OpDiv32:
182 return rewriteValueWasm_OpDiv32(v)
183 case OpDiv32F:
184 v.Op = OpWasmF32Div
185 return true
186 case OpDiv32u:
187 return rewriteValueWasm_OpDiv32u(v)
188 case OpDiv64:
189 return rewriteValueWasm_OpDiv64(v)
190 case OpDiv64F:
191 v.Op = OpWasmF64Div
192 return true
193 case OpDiv64u:
194 v.Op = OpWasmI64DivU
195 return true
196 case OpDiv8:
197 return rewriteValueWasm_OpDiv8(v)
198 case OpDiv8u:
199 return rewriteValueWasm_OpDiv8u(v)
200 case OpEq16:
201 return rewriteValueWasm_OpEq16(v)
202 case OpEq32:
203 return rewriteValueWasm_OpEq32(v)
204 case OpEq32F:
205 v.Op = OpWasmF32Eq
206 return true
207 case OpEq64:
208 v.Op = OpWasmI64Eq
209 return true
210 case OpEq64F:
211 v.Op = OpWasmF64Eq
212 return true
213 case OpEq8:
214 return rewriteValueWasm_OpEq8(v)
215 case OpEqB:
216 v.Op = OpWasmI64Eq
217 return true
218 case OpEqPtr:
219 v.Op = OpWasmI64Eq
220 return true
221 case OpFloor:
222 v.Op = OpWasmF64Floor
223 return true
224 case OpGetCallerPC:
225 v.Op = OpWasmLoweredGetCallerPC
226 return true
227 case OpGetCallerSP:
228 v.Op = OpWasmLoweredGetCallerSP
229 return true
230 case OpGetClosurePtr:
231 v.Op = OpWasmLoweredGetClosurePtr
232 return true
233 case OpHmul64:
234 return rewriteValueWasm_OpHmul64(v)
235 case OpHmul64u:
236 return rewriteValueWasm_OpHmul64u(v)
237 case OpInterCall:
238 v.Op = OpWasmLoweredInterCall
239 return true
240 case OpIsInBounds:
241 v.Op = OpWasmI64LtU
242 return true
243 case OpIsNonNil:
244 return rewriteValueWasm_OpIsNonNil(v)
245 case OpIsSliceInBounds:
246 v.Op = OpWasmI64LeU
247 return true
248 case OpLast:
249 return rewriteValueWasm_OpLast(v)
250 case OpLeq16:
251 return rewriteValueWasm_OpLeq16(v)
252 case OpLeq16U:
253 return rewriteValueWasm_OpLeq16U(v)
254 case OpLeq32:
255 return rewriteValueWasm_OpLeq32(v)
256 case OpLeq32F:
257 v.Op = OpWasmF32Le
258 return true
259 case OpLeq32U:
260 return rewriteValueWasm_OpLeq32U(v)
261 case OpLeq64:
262 v.Op = OpWasmI64LeS
263 return true
264 case OpLeq64F:
265 v.Op = OpWasmF64Le
266 return true
267 case OpLeq64U:
268 v.Op = OpWasmI64LeU
269 return true
270 case OpLeq8:
271 return rewriteValueWasm_OpLeq8(v)
272 case OpLeq8U:
273 return rewriteValueWasm_OpLeq8U(v)
274 case OpLess16:
275 return rewriteValueWasm_OpLess16(v)
276 case OpLess16U:
277 return rewriteValueWasm_OpLess16U(v)
278 case OpLess32:
279 return rewriteValueWasm_OpLess32(v)
280 case OpLess32F:
281 v.Op = OpWasmF32Lt
282 return true
283 case OpLess32U:
284 return rewriteValueWasm_OpLess32U(v)
285 case OpLess64:
286 v.Op = OpWasmI64LtS
287 return true
288 case OpLess64F:
289 v.Op = OpWasmF64Lt
290 return true
291 case OpLess64U:
292 v.Op = OpWasmI64LtU
293 return true
294 case OpLess8:
295 return rewriteValueWasm_OpLess8(v)
296 case OpLess8U:
297 return rewriteValueWasm_OpLess8U(v)
298 case OpLoad:
299 return rewriteValueWasm_OpLoad(v)
300 case OpLocalAddr:
301 return rewriteValueWasm_OpLocalAddr(v)
302 case OpLsh16x16:
303 return rewriteValueWasm_OpLsh16x16(v)
304 case OpLsh16x32:
305 return rewriteValueWasm_OpLsh16x32(v)
306 case OpLsh16x64:
307 v.Op = OpLsh64x64
308 return true
309 case OpLsh16x8:
310 return rewriteValueWasm_OpLsh16x8(v)
311 case OpLsh32x16:
312 return rewriteValueWasm_OpLsh32x16(v)
313 case OpLsh32x32:
314 return rewriteValueWasm_OpLsh32x32(v)
315 case OpLsh32x64:
316 v.Op = OpLsh64x64
317 return true
318 case OpLsh32x8:
319 return rewriteValueWasm_OpLsh32x8(v)
320 case OpLsh64x16:
321 return rewriteValueWasm_OpLsh64x16(v)
322 case OpLsh64x32:
323 return rewriteValueWasm_OpLsh64x32(v)
324 case OpLsh64x64:
325 return rewriteValueWasm_OpLsh64x64(v)
326 case OpLsh64x8:
327 return rewriteValueWasm_OpLsh64x8(v)
328 case OpLsh8x16:
329 return rewriteValueWasm_OpLsh8x16(v)
330 case OpLsh8x32:
331 return rewriteValueWasm_OpLsh8x32(v)
332 case OpLsh8x64:
333 v.Op = OpLsh64x64
334 return true
335 case OpLsh8x8:
336 return rewriteValueWasm_OpLsh8x8(v)
337 case OpMod16:
338 return rewriteValueWasm_OpMod16(v)
339 case OpMod16u:
340 return rewriteValueWasm_OpMod16u(v)
341 case OpMod32:
342 return rewriteValueWasm_OpMod32(v)
343 case OpMod32u:
344 return rewriteValueWasm_OpMod32u(v)
345 case OpMod64:
346 return rewriteValueWasm_OpMod64(v)
347 case OpMod64u:
348 v.Op = OpWasmI64RemU
349 return true
350 case OpMod8:
351 return rewriteValueWasm_OpMod8(v)
352 case OpMod8u:
353 return rewriteValueWasm_OpMod8u(v)
354 case OpMove:
355 return rewriteValueWasm_OpMove(v)
356 case OpMul16:
357 v.Op = OpWasmI64Mul
358 return true
359 case OpMul32:
360 v.Op = OpWasmI64Mul
361 return true
362 case OpMul32F:
363 v.Op = OpWasmF32Mul
364 return true
365 case OpMul64:
366 v.Op = OpWasmI64Mul
367 return true
368 case OpMul64F:
369 v.Op = OpWasmF64Mul
370 return true
371 case OpMul8:
372 v.Op = OpWasmI64Mul
373 return true
374 case OpNeg16:
375 return rewriteValueWasm_OpNeg16(v)
376 case OpNeg32:
377 return rewriteValueWasm_OpNeg32(v)
378 case OpNeg32F:
379 v.Op = OpWasmF32Neg
380 return true
381 case OpNeg64:
382 return rewriteValueWasm_OpNeg64(v)
383 case OpNeg64F:
384 v.Op = OpWasmF64Neg
385 return true
386 case OpNeg8:
387 return rewriteValueWasm_OpNeg8(v)
388 case OpNeq16:
389 return rewriteValueWasm_OpNeq16(v)
390 case OpNeq32:
391 return rewriteValueWasm_OpNeq32(v)
392 case OpNeq32F:
393 v.Op = OpWasmF32Ne
394 return true
395 case OpNeq64:
396 v.Op = OpWasmI64Ne
397 return true
398 case OpNeq64F:
399 v.Op = OpWasmF64Ne
400 return true
401 case OpNeq8:
402 return rewriteValueWasm_OpNeq8(v)
403 case OpNeqB:
404 v.Op = OpWasmI64Ne
405 return true
406 case OpNeqPtr:
407 v.Op = OpWasmI64Ne
408 return true
409 case OpNilCheck:
410 v.Op = OpWasmLoweredNilCheck
411 return true
412 case OpNot:
413 v.Op = OpWasmI64Eqz
414 return true
415 case OpOffPtr:
416 v.Op = OpWasmI64AddConst
417 return true
418 case OpOr16:
419 v.Op = OpWasmI64Or
420 return true
421 case OpOr32:
422 v.Op = OpWasmI64Or
423 return true
424 case OpOr64:
425 v.Op = OpWasmI64Or
426 return true
427 case OpOr8:
428 v.Op = OpWasmI64Or
429 return true
430 case OpOrB:
431 v.Op = OpWasmI64Or
432 return true
433 case OpPopCount16:
434 return rewriteValueWasm_OpPopCount16(v)
435 case OpPopCount32:
436 return rewriteValueWasm_OpPopCount32(v)
437 case OpPopCount64:
438 v.Op = OpWasmI64Popcnt
439 return true
440 case OpPopCount8:
441 return rewriteValueWasm_OpPopCount8(v)
442 case OpRotateLeft16:
443 return rewriteValueWasm_OpRotateLeft16(v)
444 case OpRotateLeft32:
445 v.Op = OpWasmI32Rotl
446 return true
447 case OpRotateLeft64:
448 v.Op = OpWasmI64Rotl
449 return true
450 case OpRotateLeft8:
451 return rewriteValueWasm_OpRotateLeft8(v)
452 case OpRound32F:
453 v.Op = OpCopy
454 return true
455 case OpRound64F:
456 v.Op = OpCopy
457 return true
458 case OpRoundToEven:
459 v.Op = OpWasmF64Nearest
460 return true
461 case OpRsh16Ux16:
462 return rewriteValueWasm_OpRsh16Ux16(v)
463 case OpRsh16Ux32:
464 return rewriteValueWasm_OpRsh16Ux32(v)
465 case OpRsh16Ux64:
466 return rewriteValueWasm_OpRsh16Ux64(v)
467 case OpRsh16Ux8:
468 return rewriteValueWasm_OpRsh16Ux8(v)
469 case OpRsh16x16:
470 return rewriteValueWasm_OpRsh16x16(v)
471 case OpRsh16x32:
472 return rewriteValueWasm_OpRsh16x32(v)
473 case OpRsh16x64:
474 return rewriteValueWasm_OpRsh16x64(v)
475 case OpRsh16x8:
476 return rewriteValueWasm_OpRsh16x8(v)
477 case OpRsh32Ux16:
478 return rewriteValueWasm_OpRsh32Ux16(v)
479 case OpRsh32Ux32:
480 return rewriteValueWasm_OpRsh32Ux32(v)
481 case OpRsh32Ux64:
482 return rewriteValueWasm_OpRsh32Ux64(v)
483 case OpRsh32Ux8:
484 return rewriteValueWasm_OpRsh32Ux8(v)
485 case OpRsh32x16:
486 return rewriteValueWasm_OpRsh32x16(v)
487 case OpRsh32x32:
488 return rewriteValueWasm_OpRsh32x32(v)
489 case OpRsh32x64:
490 return rewriteValueWasm_OpRsh32x64(v)
491 case OpRsh32x8:
492 return rewriteValueWasm_OpRsh32x8(v)
493 case OpRsh64Ux16:
494 return rewriteValueWasm_OpRsh64Ux16(v)
495 case OpRsh64Ux32:
496 return rewriteValueWasm_OpRsh64Ux32(v)
497 case OpRsh64Ux64:
498 return rewriteValueWasm_OpRsh64Ux64(v)
499 case OpRsh64Ux8:
500 return rewriteValueWasm_OpRsh64Ux8(v)
501 case OpRsh64x16:
502 return rewriteValueWasm_OpRsh64x16(v)
503 case OpRsh64x32:
504 return rewriteValueWasm_OpRsh64x32(v)
505 case OpRsh64x64:
506 return rewriteValueWasm_OpRsh64x64(v)
507 case OpRsh64x8:
508 return rewriteValueWasm_OpRsh64x8(v)
509 case OpRsh8Ux16:
510 return rewriteValueWasm_OpRsh8Ux16(v)
511 case OpRsh8Ux32:
512 return rewriteValueWasm_OpRsh8Ux32(v)
513 case OpRsh8Ux64:
514 return rewriteValueWasm_OpRsh8Ux64(v)
515 case OpRsh8Ux8:
516 return rewriteValueWasm_OpRsh8Ux8(v)
517 case OpRsh8x16:
518 return rewriteValueWasm_OpRsh8x16(v)
519 case OpRsh8x32:
520 return rewriteValueWasm_OpRsh8x32(v)
521 case OpRsh8x64:
522 return rewriteValueWasm_OpRsh8x64(v)
523 case OpRsh8x8:
524 return rewriteValueWasm_OpRsh8x8(v)
525 case OpSelect0:
526 return rewriteValueWasm_OpSelect0(v)
527 case OpSelect1:
528 return rewriteValueWasm_OpSelect1(v)
529 case OpSignExt16to32:
530 return rewriteValueWasm_OpSignExt16to32(v)
531 case OpSignExt16to64:
532 return rewriteValueWasm_OpSignExt16to64(v)
533 case OpSignExt32to64:
534 return rewriteValueWasm_OpSignExt32to64(v)
535 case OpSignExt8to16:
536 return rewriteValueWasm_OpSignExt8to16(v)
537 case OpSignExt8to32:
538 return rewriteValueWasm_OpSignExt8to32(v)
539 case OpSignExt8to64:
540 return rewriteValueWasm_OpSignExt8to64(v)
541 case OpSlicemask:
542 return rewriteValueWasm_OpSlicemask(v)
543 case OpSqrt:
544 v.Op = OpWasmF64Sqrt
545 return true
546 case OpSqrt32:
547 v.Op = OpWasmF32Sqrt
548 return true
549 case OpStaticCall:
550 v.Op = OpWasmLoweredStaticCall
551 return true
552 case OpStore:
553 return rewriteValueWasm_OpStore(v)
554 case OpSub16:
555 v.Op = OpWasmI64Sub
556 return true
557 case OpSub32:
558 v.Op = OpWasmI64Sub
559 return true
560 case OpSub32F:
561 v.Op = OpWasmF32Sub
562 return true
563 case OpSub64:
564 v.Op = OpWasmI64Sub
565 return true
566 case OpSub64F:
567 v.Op = OpWasmF64Sub
568 return true
569 case OpSub8:
570 v.Op = OpWasmI64Sub
571 return true
572 case OpSubPtr:
573 v.Op = OpWasmI64Sub
574 return true
575 case OpTailCall:
576 v.Op = OpWasmLoweredTailCall
577 return true
578 case OpTailCallInter:
579 v.Op = OpWasmLoweredTailCallInter
580 return true
581 case OpTrunc:
582 v.Op = OpWasmF64Trunc
583 return true
584 case OpTrunc16to8:
585 v.Op = OpCopy
586 return true
587 case OpTrunc32to16:
588 v.Op = OpCopy
589 return true
590 case OpTrunc32to8:
591 v.Op = OpCopy
592 return true
593 case OpTrunc64to16:
594 v.Op = OpCopy
595 return true
596 case OpTrunc64to32:
597 v.Op = OpCopy
598 return true
599 case OpTrunc64to8:
600 v.Op = OpCopy
601 return true
602 case OpWB:
603 v.Op = OpWasmLoweredWB
604 return true
605 case OpWasmF32DemoteF64:
606 return rewriteValueWasm_OpWasmF32DemoteF64(v)
607 case OpWasmF64Add:
608 return rewriteValueWasm_OpWasmF64Add(v)
609 case OpWasmF64Mul:
610 return rewriteValueWasm_OpWasmF64Mul(v)
611 case OpWasmI64Add:
612 return rewriteValueWasm_OpWasmI64Add(v)
613 case OpWasmI64AddConst:
614 return rewriteValueWasm_OpWasmI64AddConst(v)
615 case OpWasmI64And:
616 return rewriteValueWasm_OpWasmI64And(v)
617 case OpWasmI64Eq:
618 return rewriteValueWasm_OpWasmI64Eq(v)
619 case OpWasmI64Eqz:
620 return rewriteValueWasm_OpWasmI64Eqz(v)
621 case OpWasmI64Extend16S:
622 return rewriteValueWasm_OpWasmI64Extend16S(v)
623 case OpWasmI64Extend32S:
624 return rewriteValueWasm_OpWasmI64Extend32S(v)
625 case OpWasmI64Extend8S:
626 return rewriteValueWasm_OpWasmI64Extend8S(v)
627 case OpWasmI64LeU:
628 return rewriteValueWasm_OpWasmI64LeU(v)
629 case OpWasmI64Load:
630 return rewriteValueWasm_OpWasmI64Load(v)
631 case OpWasmI64Load16S:
632 return rewriteValueWasm_OpWasmI64Load16S(v)
633 case OpWasmI64Load16U:
634 return rewriteValueWasm_OpWasmI64Load16U(v)
635 case OpWasmI64Load32S:
636 return rewriteValueWasm_OpWasmI64Load32S(v)
637 case OpWasmI64Load32U:
638 return rewriteValueWasm_OpWasmI64Load32U(v)
639 case OpWasmI64Load8S:
640 return rewriteValueWasm_OpWasmI64Load8S(v)
641 case OpWasmI64Load8U:
642 return rewriteValueWasm_OpWasmI64Load8U(v)
643 case OpWasmI64LtU:
644 return rewriteValueWasm_OpWasmI64LtU(v)
645 case OpWasmI64Mul:
646 return rewriteValueWasm_OpWasmI64Mul(v)
647 case OpWasmI64Ne:
648 return rewriteValueWasm_OpWasmI64Ne(v)
649 case OpWasmI64Or:
650 return rewriteValueWasm_OpWasmI64Or(v)
651 case OpWasmI64Shl:
652 return rewriteValueWasm_OpWasmI64Shl(v)
653 case OpWasmI64ShrS:
654 return rewriteValueWasm_OpWasmI64ShrS(v)
655 case OpWasmI64ShrU:
656 return rewriteValueWasm_OpWasmI64ShrU(v)
657 case OpWasmI64Store:
658 return rewriteValueWasm_OpWasmI64Store(v)
659 case OpWasmI64Store16:
660 return rewriteValueWasm_OpWasmI64Store16(v)
661 case OpWasmI64Store32:
662 return rewriteValueWasm_OpWasmI64Store32(v)
663 case OpWasmI64Store8:
664 return rewriteValueWasm_OpWasmI64Store8(v)
665 case OpWasmI64Sub:
666 return rewriteValueWasm_OpWasmI64Sub(v)
667 case OpWasmI64Xor:
668 return rewriteValueWasm_OpWasmI64Xor(v)
669 case OpXor16:
670 v.Op = OpWasmI64Xor
671 return true
672 case OpXor32:
673 v.Op = OpWasmI64Xor
674 return true
675 case OpXor64:
676 v.Op = OpWasmI64Xor
677 return true
678 case OpXor8:
679 v.Op = OpWasmI64Xor
680 return true
681 case OpZero:
682 return rewriteValueWasm_OpZero(v)
683 case OpZeroExt16to32:
684 return rewriteValueWasm_OpZeroExt16to32(v)
685 case OpZeroExt16to64:
686 return rewriteValueWasm_OpZeroExt16to64(v)
687 case OpZeroExt32to64:
688 return rewriteValueWasm_OpZeroExt32to64(v)
689 case OpZeroExt8to16:
690 return rewriteValueWasm_OpZeroExt8to16(v)
691 case OpZeroExt8to32:
692 return rewriteValueWasm_OpZeroExt8to32(v)
693 case OpZeroExt8to64:
694 return rewriteValueWasm_OpZeroExt8to64(v)
695 }
696 return false
697 }
698 func rewriteValueWasm_OpAddr(v *Value) bool {
699 v_0 := v.Args[0]
700
701
702 for {
703 sym := auxToSym(v.Aux)
704 base := v_0
705 v.reset(OpWasmLoweredAddr)
706 v.AuxInt = int32ToAuxInt(0)
707 v.Aux = symToAux(sym)
708 v.AddArg(base)
709 return true
710 }
711 }
712 func rewriteValueWasm_OpAvg64u(v *Value) bool {
713 v_1 := v.Args[1]
714 v_0 := v.Args[0]
715 b := v.Block
716 typ := &b.Func.Config.Types
717
718
719 for {
720 x := v_0
721 y := v_1
722 v.reset(OpWasmI64Add)
723 v0 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
724 v1 := b.NewValue0(v.Pos, OpWasmI64Sub, typ.Int64)
725 v1.AddArg2(x, y)
726 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
727 v2.AuxInt = int64ToAuxInt(1)
728 v0.AddArg2(v1, v2)
729 v.AddArg2(v0, y)
730 return true
731 }
732 }
733 func rewriteValueWasm_OpBitLen16(v *Value) bool {
734 v_0 := v.Args[0]
735 b := v.Block
736 typ := &b.Func.Config.Types
737
738
739 for {
740 x := v_0
741 v.reset(OpBitLen64)
742 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
743 v0.AddArg(x)
744 v.AddArg(v0)
745 return true
746 }
747 }
748 func rewriteValueWasm_OpBitLen32(v *Value) bool {
749 v_0 := v.Args[0]
750 b := v.Block
751 typ := &b.Func.Config.Types
752
753
754 for {
755 x := v_0
756 v.reset(OpBitLen64)
757 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
758 v0.AddArg(x)
759 v.AddArg(v0)
760 return true
761 }
762 }
763 func rewriteValueWasm_OpBitLen64(v *Value) bool {
764 v_0 := v.Args[0]
765 b := v.Block
766 typ := &b.Func.Config.Types
767
768
769 for {
770 x := v_0
771 v.reset(OpWasmI64Sub)
772 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
773 v0.AuxInt = int64ToAuxInt(64)
774 v1 := b.NewValue0(v.Pos, OpWasmI64Clz, typ.Int64)
775 v1.AddArg(x)
776 v.AddArg2(v0, v1)
777 return true
778 }
779 }
780 func rewriteValueWasm_OpBitLen8(v *Value) bool {
781 v_0 := v.Args[0]
782 b := v.Block
783 typ := &b.Func.Config.Types
784
785
786 for {
787 x := v_0
788 v.reset(OpBitLen64)
789 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
790 v0.AddArg(x)
791 v.AddArg(v0)
792 return true
793 }
794 }
795 func rewriteValueWasm_OpCom16(v *Value) bool {
796 v_0 := v.Args[0]
797 b := v.Block
798 typ := &b.Func.Config.Types
799
800
801 for {
802 x := v_0
803 v.reset(OpWasmI64Xor)
804 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
805 v0.AuxInt = int64ToAuxInt(-1)
806 v.AddArg2(x, v0)
807 return true
808 }
809 }
810 func rewriteValueWasm_OpCom32(v *Value) bool {
811 v_0 := v.Args[0]
812 b := v.Block
813 typ := &b.Func.Config.Types
814
815
816 for {
817 x := v_0
818 v.reset(OpWasmI64Xor)
819 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
820 v0.AuxInt = int64ToAuxInt(-1)
821 v.AddArg2(x, v0)
822 return true
823 }
824 }
825 func rewriteValueWasm_OpCom64(v *Value) bool {
826 v_0 := v.Args[0]
827 b := v.Block
828 typ := &b.Func.Config.Types
829
830
831 for {
832 x := v_0
833 v.reset(OpWasmI64Xor)
834 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
835 v0.AuxInt = int64ToAuxInt(-1)
836 v.AddArg2(x, v0)
837 return true
838 }
839 }
840 func rewriteValueWasm_OpCom8(v *Value) bool {
841 v_0 := v.Args[0]
842 b := v.Block
843 typ := &b.Func.Config.Types
844
845
846 for {
847 x := v_0
848 v.reset(OpWasmI64Xor)
849 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
850 v0.AuxInt = int64ToAuxInt(-1)
851 v.AddArg2(x, v0)
852 return true
853 }
854 }
855 func rewriteValueWasm_OpConst16(v *Value) bool {
856
857
858 for {
859 c := auxIntToInt16(v.AuxInt)
860 v.reset(OpWasmI64Const)
861 v.AuxInt = int64ToAuxInt(int64(c))
862 return true
863 }
864 }
865 func rewriteValueWasm_OpConst32(v *Value) bool {
866
867
868 for {
869 c := auxIntToInt32(v.AuxInt)
870 v.reset(OpWasmI64Const)
871 v.AuxInt = int64ToAuxInt(int64(c))
872 return true
873 }
874 }
875 func rewriteValueWasm_OpConst8(v *Value) bool {
876
877
878 for {
879 c := auxIntToInt8(v.AuxInt)
880 v.reset(OpWasmI64Const)
881 v.AuxInt = int64ToAuxInt(int64(c))
882 return true
883 }
884 }
885 func rewriteValueWasm_OpConstBool(v *Value) bool {
886
887
888 for {
889 c := auxIntToBool(v.AuxInt)
890 v.reset(OpWasmI64Const)
891 v.AuxInt = int64ToAuxInt(b2i(c))
892 return true
893 }
894 }
895 func rewriteValueWasm_OpConstNil(v *Value) bool {
896
897
898 for {
899 v.reset(OpWasmI64Const)
900 v.AuxInt = int64ToAuxInt(0)
901 return true
902 }
903 }
904 func rewriteValueWasm_OpCtz16(v *Value) bool {
905 v_0 := v.Args[0]
906 b := v.Block
907 typ := &b.Func.Config.Types
908
909
910 for {
911 x := v_0
912 v.reset(OpWasmI64Ctz)
913 v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
914 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
915 v1.AuxInt = int64ToAuxInt(0x10000)
916 v0.AddArg2(x, v1)
917 v.AddArg(v0)
918 return true
919 }
920 }
921 func rewriteValueWasm_OpCtz32(v *Value) bool {
922 v_0 := v.Args[0]
923 b := v.Block
924 typ := &b.Func.Config.Types
925
926
927 for {
928 x := v_0
929 v.reset(OpWasmI64Ctz)
930 v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
931 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
932 v1.AuxInt = int64ToAuxInt(0x100000000)
933 v0.AddArg2(x, v1)
934 v.AddArg(v0)
935 return true
936 }
937 }
938 func rewriteValueWasm_OpCtz8(v *Value) bool {
939 v_0 := v.Args[0]
940 b := v.Block
941 typ := &b.Func.Config.Types
942
943
944 for {
945 x := v_0
946 v.reset(OpWasmI64Ctz)
947 v0 := b.NewValue0(v.Pos, OpWasmI64Or, typ.Int64)
948 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
949 v1.AuxInt = int64ToAuxInt(0x100)
950 v0.AddArg2(x, v1)
951 v.AddArg(v0)
952 return true
953 }
954 }
955 func rewriteValueWasm_OpCvt32Uto32F(v *Value) bool {
956 v_0 := v.Args[0]
957 b := v.Block
958 typ := &b.Func.Config.Types
959
960
961 for {
962 x := v_0
963 v.reset(OpWasmF32ConvertI64U)
964 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
965 v0.AddArg(x)
966 v.AddArg(v0)
967 return true
968 }
969 }
970 func rewriteValueWasm_OpCvt32Uto64F(v *Value) bool {
971 v_0 := v.Args[0]
972 b := v.Block
973 typ := &b.Func.Config.Types
974
975
976 for {
977 x := v_0
978 v.reset(OpWasmF64ConvertI64U)
979 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
980 v0.AddArg(x)
981 v.AddArg(v0)
982 return true
983 }
984 }
985 func rewriteValueWasm_OpCvt32to32F(v *Value) bool {
986 v_0 := v.Args[0]
987 b := v.Block
988 typ := &b.Func.Config.Types
989
990
991 for {
992 x := v_0
993 v.reset(OpWasmF32ConvertI64S)
994 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
995 v0.AddArg(x)
996 v.AddArg(v0)
997 return true
998 }
999 }
1000 func rewriteValueWasm_OpCvt32to64F(v *Value) bool {
1001 v_0 := v.Args[0]
1002 b := v.Block
1003 typ := &b.Func.Config.Types
1004
1005
1006 for {
1007 x := v_0
1008 v.reset(OpWasmF64ConvertI64S)
1009 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1010 v0.AddArg(x)
1011 v.AddArg(v0)
1012 return true
1013 }
1014 }
1015 func rewriteValueWasm_OpDiv16(v *Value) bool {
1016 v_1 := v.Args[1]
1017 v_0 := v.Args[0]
1018 b := v.Block
1019 typ := &b.Func.Config.Types
1020
1021
1022 for {
1023 if auxIntToBool(v.AuxInt) != false {
1024 break
1025 }
1026 x := v_0
1027 y := v_1
1028 v.reset(OpWasmI64DivS)
1029 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1030 v0.AddArg(x)
1031 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1032 v1.AddArg(y)
1033 v.AddArg2(v0, v1)
1034 return true
1035 }
1036 return false
1037 }
1038 func rewriteValueWasm_OpDiv16u(v *Value) bool {
1039 v_1 := v.Args[1]
1040 v_0 := v.Args[0]
1041 b := v.Block
1042 typ := &b.Func.Config.Types
1043
1044
1045 for {
1046 x := v_0
1047 y := v_1
1048 v.reset(OpWasmI64DivU)
1049 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1050 v0.AddArg(x)
1051 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1052 v1.AddArg(y)
1053 v.AddArg2(v0, v1)
1054 return true
1055 }
1056 }
1057 func rewriteValueWasm_OpDiv32(v *Value) bool {
1058 v_1 := v.Args[1]
1059 v_0 := v.Args[0]
1060 b := v.Block
1061 typ := &b.Func.Config.Types
1062
1063
1064 for {
1065 if auxIntToBool(v.AuxInt) != false {
1066 break
1067 }
1068 x := v_0
1069 y := v_1
1070 v.reset(OpWasmI64DivS)
1071 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1072 v0.AddArg(x)
1073 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1074 v1.AddArg(y)
1075 v.AddArg2(v0, v1)
1076 return true
1077 }
1078 return false
1079 }
1080 func rewriteValueWasm_OpDiv32u(v *Value) bool {
1081 v_1 := v.Args[1]
1082 v_0 := v.Args[0]
1083 b := v.Block
1084 typ := &b.Func.Config.Types
1085
1086
1087 for {
1088 x := v_0
1089 y := v_1
1090 v.reset(OpWasmI64DivU)
1091 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1092 v0.AddArg(x)
1093 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1094 v1.AddArg(y)
1095 v.AddArg2(v0, v1)
1096 return true
1097 }
1098 }
1099 func rewriteValueWasm_OpDiv64(v *Value) bool {
1100 v_1 := v.Args[1]
1101 v_0 := v.Args[0]
1102
1103
1104 for {
1105 if auxIntToBool(v.AuxInt) != false {
1106 break
1107 }
1108 x := v_0
1109 y := v_1
1110 v.reset(OpWasmI64DivS)
1111 v.AddArg2(x, y)
1112 return true
1113 }
1114 return false
1115 }
1116 func rewriteValueWasm_OpDiv8(v *Value) bool {
1117 v_1 := v.Args[1]
1118 v_0 := v.Args[0]
1119 b := v.Block
1120 typ := &b.Func.Config.Types
1121
1122
1123 for {
1124 x := v_0
1125 y := v_1
1126 v.reset(OpWasmI64DivS)
1127 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1128 v0.AddArg(x)
1129 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1130 v1.AddArg(y)
1131 v.AddArg2(v0, v1)
1132 return true
1133 }
1134 }
1135 func rewriteValueWasm_OpDiv8u(v *Value) bool {
1136 v_1 := v.Args[1]
1137 v_0 := v.Args[0]
1138 b := v.Block
1139 typ := &b.Func.Config.Types
1140
1141
1142 for {
1143 x := v_0
1144 y := v_1
1145 v.reset(OpWasmI64DivU)
1146 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1147 v0.AddArg(x)
1148 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1149 v1.AddArg(y)
1150 v.AddArg2(v0, v1)
1151 return true
1152 }
1153 }
1154 func rewriteValueWasm_OpEq16(v *Value) bool {
1155 v_1 := v.Args[1]
1156 v_0 := v.Args[0]
1157 b := v.Block
1158 typ := &b.Func.Config.Types
1159
1160
1161 for {
1162 x := v_0
1163 y := v_1
1164 v.reset(OpWasmI64Eq)
1165 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1166 v0.AddArg(x)
1167 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1168 v1.AddArg(y)
1169 v.AddArg2(v0, v1)
1170 return true
1171 }
1172 }
1173 func rewriteValueWasm_OpEq32(v *Value) bool {
1174 v_1 := v.Args[1]
1175 v_0 := v.Args[0]
1176 b := v.Block
1177 typ := &b.Func.Config.Types
1178
1179
1180 for {
1181 x := v_0
1182 y := v_1
1183 v.reset(OpWasmI64Eq)
1184 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1185 v0.AddArg(x)
1186 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1187 v1.AddArg(y)
1188 v.AddArg2(v0, v1)
1189 return true
1190 }
1191 }
1192 func rewriteValueWasm_OpEq8(v *Value) bool {
1193 v_1 := v.Args[1]
1194 v_0 := v.Args[0]
1195 b := v.Block
1196 typ := &b.Func.Config.Types
1197
1198
1199 for {
1200 x := v_0
1201 y := v_1
1202 v.reset(OpWasmI64Eq)
1203 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1204 v0.AddArg(x)
1205 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1206 v1.AddArg(y)
1207 v.AddArg2(v0, v1)
1208 return true
1209 }
1210 }
1211 func rewriteValueWasm_OpHmul64(v *Value) bool {
1212 v_1 := v.Args[1]
1213 v_0 := v.Args[0]
1214 b := v.Block
1215 typ := &b.Func.Config.Types
1216
1217
1218 for {
1219 t := v.Type
1220 x := v_0
1221 y := v_1
1222 v.reset(OpLast)
1223 v.Type = t
1224 x0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1225 x0.AddArg(x)
1226 x1 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
1227 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
1228 v2.AuxInt = int64ToAuxInt(32)
1229 x1.AddArg2(x, v2)
1230 y0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1231 y0.AddArg(y)
1232 y1 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
1233 y1.AddArg2(y, v2)
1234 x0y0 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1235 x0y0.AddArg2(x0, y0)
1236 tt := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1237 v7 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1238 v7.AddArg2(x1, y0)
1239 v8 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1240 v8.AddArg2(x0y0, v2)
1241 tt.AddArg2(v7, v8)
1242 w1 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1243 v10 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1244 v10.AddArg2(x0, y1)
1245 v11 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1246 v11.AddArg(tt)
1247 w1.AddArg2(v10, v11)
1248 w2 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
1249 w2.AddArg2(tt, v2)
1250 v13 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1251 v14 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1252 v15 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1253 v15.AddArg2(x1, y1)
1254 v14.AddArg2(v15, w2)
1255 v16 := b.NewValue0(v.Pos, OpWasmI64ShrS, typ.Int64)
1256 v16.AddArg2(w1, v2)
1257 v13.AddArg2(v14, v16)
1258 v.AddArgs(x0, x1, y0, y1, x0y0, tt, w1, w2, v13)
1259 return true
1260 }
1261 }
1262 func rewriteValueWasm_OpHmul64u(v *Value) bool {
1263 v_1 := v.Args[1]
1264 v_0 := v.Args[0]
1265 b := v.Block
1266 typ := &b.Func.Config.Types
1267
1268
1269 for {
1270 t := v.Type
1271 x := v_0
1272 y := v_1
1273 v.reset(OpLast)
1274 v.Type = t
1275 x0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1276 x0.AddArg(x)
1277 x1 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1278 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
1279 v2.AuxInt = int64ToAuxInt(32)
1280 x1.AddArg2(x, v2)
1281 y0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1282 y0.AddArg(y)
1283 y1 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1284 y1.AddArg2(y, v2)
1285 w0 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1286 w0.AddArg2(x0, y0)
1287 tt := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1288 v7 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1289 v7.AddArg2(x1, y0)
1290 v8 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1291 v8.AddArg2(w0, v2)
1292 tt.AddArg2(v7, v8)
1293 w1 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1294 v10 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1295 v10.AddArg2(x0, y1)
1296 v11 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1297 v11.AddArg(tt)
1298 w1.AddArg2(v10, v11)
1299 w2 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1300 w2.AddArg2(tt, v2)
1301 hi := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1302 v14 := b.NewValue0(v.Pos, OpWasmI64Add, typ.Int64)
1303 v15 := b.NewValue0(v.Pos, OpWasmI64Mul, typ.Int64)
1304 v15.AddArg2(x1, y1)
1305 v14.AddArg2(v15, w2)
1306 v16 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
1307 v16.AddArg2(w1, v2)
1308 hi.AddArg2(v14, v16)
1309 v.AddArgs(x0, x1, y0, y1, w0, tt, w1, w2, hi)
1310 return true
1311 }
1312 }
1313 func rewriteValueWasm_OpIsNonNil(v *Value) bool {
1314 v_0 := v.Args[0]
1315 b := v.Block
1316 typ := &b.Func.Config.Types
1317
1318
1319 for {
1320 p := v_0
1321 v.reset(OpWasmI64Eqz)
1322 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
1323 v0.AddArg(p)
1324 v.AddArg(v0)
1325 return true
1326 }
1327 }
1328 func rewriteValueWasm_OpLast(v *Value) bool {
1329
1330
1331 for {
1332 v.copyOf(v.Args[len(v.Args)-1])
1333 return true
1334 }
1335 }
1336 func rewriteValueWasm_OpLeq16(v *Value) bool {
1337 v_1 := v.Args[1]
1338 v_0 := v.Args[0]
1339 b := v.Block
1340 typ := &b.Func.Config.Types
1341
1342
1343 for {
1344 x := v_0
1345 y := v_1
1346 v.reset(OpWasmI64LeS)
1347 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1348 v0.AddArg(x)
1349 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1350 v1.AddArg(y)
1351 v.AddArg2(v0, v1)
1352 return true
1353 }
1354 }
1355 func rewriteValueWasm_OpLeq16U(v *Value) bool {
1356 v_1 := v.Args[1]
1357 v_0 := v.Args[0]
1358 b := v.Block
1359 typ := &b.Func.Config.Types
1360
1361
1362 for {
1363 x := v_0
1364 y := v_1
1365 v.reset(OpWasmI64LeU)
1366 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1367 v0.AddArg(x)
1368 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1369 v1.AddArg(y)
1370 v.AddArg2(v0, v1)
1371 return true
1372 }
1373 }
1374 func rewriteValueWasm_OpLeq32(v *Value) bool {
1375 v_1 := v.Args[1]
1376 v_0 := v.Args[0]
1377 b := v.Block
1378 typ := &b.Func.Config.Types
1379
1380
1381 for {
1382 x := v_0
1383 y := v_1
1384 v.reset(OpWasmI64LeS)
1385 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1386 v0.AddArg(x)
1387 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1388 v1.AddArg(y)
1389 v.AddArg2(v0, v1)
1390 return true
1391 }
1392 }
1393 func rewriteValueWasm_OpLeq32U(v *Value) bool {
1394 v_1 := v.Args[1]
1395 v_0 := v.Args[0]
1396 b := v.Block
1397 typ := &b.Func.Config.Types
1398
1399
1400 for {
1401 x := v_0
1402 y := v_1
1403 v.reset(OpWasmI64LeU)
1404 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1405 v0.AddArg(x)
1406 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1407 v1.AddArg(y)
1408 v.AddArg2(v0, v1)
1409 return true
1410 }
1411 }
1412 func rewriteValueWasm_OpLeq8(v *Value) bool {
1413 v_1 := v.Args[1]
1414 v_0 := v.Args[0]
1415 b := v.Block
1416 typ := &b.Func.Config.Types
1417
1418
1419 for {
1420 x := v_0
1421 y := v_1
1422 v.reset(OpWasmI64LeS)
1423 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1424 v0.AddArg(x)
1425 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1426 v1.AddArg(y)
1427 v.AddArg2(v0, v1)
1428 return true
1429 }
1430 }
1431 func rewriteValueWasm_OpLeq8U(v *Value) bool {
1432 v_1 := v.Args[1]
1433 v_0 := v.Args[0]
1434 b := v.Block
1435 typ := &b.Func.Config.Types
1436
1437
1438 for {
1439 x := v_0
1440 y := v_1
1441 v.reset(OpWasmI64LeU)
1442 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1443 v0.AddArg(x)
1444 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1445 v1.AddArg(y)
1446 v.AddArg2(v0, v1)
1447 return true
1448 }
1449 }
1450 func rewriteValueWasm_OpLess16(v *Value) bool {
1451 v_1 := v.Args[1]
1452 v_0 := v.Args[0]
1453 b := v.Block
1454 typ := &b.Func.Config.Types
1455
1456
1457 for {
1458 x := v_0
1459 y := v_1
1460 v.reset(OpWasmI64LtS)
1461 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1462 v0.AddArg(x)
1463 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1464 v1.AddArg(y)
1465 v.AddArg2(v0, v1)
1466 return true
1467 }
1468 }
1469 func rewriteValueWasm_OpLess16U(v *Value) bool {
1470 v_1 := v.Args[1]
1471 v_0 := v.Args[0]
1472 b := v.Block
1473 typ := &b.Func.Config.Types
1474
1475
1476 for {
1477 x := v_0
1478 y := v_1
1479 v.reset(OpWasmI64LtU)
1480 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1481 v0.AddArg(x)
1482 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1483 v1.AddArg(y)
1484 v.AddArg2(v0, v1)
1485 return true
1486 }
1487 }
1488 func rewriteValueWasm_OpLess32(v *Value) bool {
1489 v_1 := v.Args[1]
1490 v_0 := v.Args[0]
1491 b := v.Block
1492 typ := &b.Func.Config.Types
1493
1494
1495 for {
1496 x := v_0
1497 y := v_1
1498 v.reset(OpWasmI64LtS)
1499 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1500 v0.AddArg(x)
1501 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1502 v1.AddArg(y)
1503 v.AddArg2(v0, v1)
1504 return true
1505 }
1506 }
1507 func rewriteValueWasm_OpLess32U(v *Value) bool {
1508 v_1 := v.Args[1]
1509 v_0 := v.Args[0]
1510 b := v.Block
1511 typ := &b.Func.Config.Types
1512
1513
1514 for {
1515 x := v_0
1516 y := v_1
1517 v.reset(OpWasmI64LtU)
1518 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1519 v0.AddArg(x)
1520 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1521 v1.AddArg(y)
1522 v.AddArg2(v0, v1)
1523 return true
1524 }
1525 }
1526 func rewriteValueWasm_OpLess8(v *Value) bool {
1527 v_1 := v.Args[1]
1528 v_0 := v.Args[0]
1529 b := v.Block
1530 typ := &b.Func.Config.Types
1531
1532
1533 for {
1534 x := v_0
1535 y := v_1
1536 v.reset(OpWasmI64LtS)
1537 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1538 v0.AddArg(x)
1539 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1540 v1.AddArg(y)
1541 v.AddArg2(v0, v1)
1542 return true
1543 }
1544 }
1545 func rewriteValueWasm_OpLess8U(v *Value) bool {
1546 v_1 := v.Args[1]
1547 v_0 := v.Args[0]
1548 b := v.Block
1549 typ := &b.Func.Config.Types
1550
1551
1552 for {
1553 x := v_0
1554 y := v_1
1555 v.reset(OpWasmI64LtU)
1556 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1557 v0.AddArg(x)
1558 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1559 v1.AddArg(y)
1560 v.AddArg2(v0, v1)
1561 return true
1562 }
1563 }
1564 func rewriteValueWasm_OpLoad(v *Value) bool {
1565 v_1 := v.Args[1]
1566 v_0 := v.Args[0]
1567
1568
1569
1570 for {
1571 t := v.Type
1572 ptr := v_0
1573 mem := v_1
1574 if !(is32BitFloat(t)) {
1575 break
1576 }
1577 v.reset(OpWasmF32Load)
1578 v.AddArg2(ptr, mem)
1579 return true
1580 }
1581
1582
1583
1584 for {
1585 t := v.Type
1586 ptr := v_0
1587 mem := v_1
1588 if !(is64BitFloat(t)) {
1589 break
1590 }
1591 v.reset(OpWasmF64Load)
1592 v.AddArg2(ptr, mem)
1593 return true
1594 }
1595
1596
1597
1598 for {
1599 t := v.Type
1600 ptr := v_0
1601 mem := v_1
1602 if !(t.Size() == 8) {
1603 break
1604 }
1605 v.reset(OpWasmI64Load)
1606 v.AddArg2(ptr, mem)
1607 return true
1608 }
1609
1610
1611
1612 for {
1613 t := v.Type
1614 ptr := v_0
1615 mem := v_1
1616 if !(t.Size() == 4 && !t.IsSigned()) {
1617 break
1618 }
1619 v.reset(OpWasmI64Load32U)
1620 v.AddArg2(ptr, mem)
1621 return true
1622 }
1623
1624
1625
1626 for {
1627 t := v.Type
1628 ptr := v_0
1629 mem := v_1
1630 if !(t.Size() == 4 && t.IsSigned()) {
1631 break
1632 }
1633 v.reset(OpWasmI64Load32S)
1634 v.AddArg2(ptr, mem)
1635 return true
1636 }
1637
1638
1639
1640 for {
1641 t := v.Type
1642 ptr := v_0
1643 mem := v_1
1644 if !(t.Size() == 2 && !t.IsSigned()) {
1645 break
1646 }
1647 v.reset(OpWasmI64Load16U)
1648 v.AddArg2(ptr, mem)
1649 return true
1650 }
1651
1652
1653
1654 for {
1655 t := v.Type
1656 ptr := v_0
1657 mem := v_1
1658 if !(t.Size() == 2 && t.IsSigned()) {
1659 break
1660 }
1661 v.reset(OpWasmI64Load16S)
1662 v.AddArg2(ptr, mem)
1663 return true
1664 }
1665
1666
1667
1668 for {
1669 t := v.Type
1670 ptr := v_0
1671 mem := v_1
1672 if !(t.Size() == 1 && !t.IsSigned()) {
1673 break
1674 }
1675 v.reset(OpWasmI64Load8U)
1676 v.AddArg2(ptr, mem)
1677 return true
1678 }
1679
1680
1681
1682 for {
1683 t := v.Type
1684 ptr := v_0
1685 mem := v_1
1686 if !(t.Size() == 1 && t.IsSigned()) {
1687 break
1688 }
1689 v.reset(OpWasmI64Load8S)
1690 v.AddArg2(ptr, mem)
1691 return true
1692 }
1693 return false
1694 }
1695 func rewriteValueWasm_OpLocalAddr(v *Value) bool {
1696 v_1 := v.Args[1]
1697 v_0 := v.Args[0]
1698 b := v.Block
1699 typ := &b.Func.Config.Types
1700
1701
1702
1703 for {
1704 t := v.Type
1705 sym := auxToSym(v.Aux)
1706 base := v_0
1707 mem := v_1
1708 if !(t.Elem().HasPointers()) {
1709 break
1710 }
1711 v.reset(OpWasmLoweredAddr)
1712 v.Aux = symToAux(sym)
1713 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
1714 v0.AddArg2(base, mem)
1715 v.AddArg(v0)
1716 return true
1717 }
1718
1719
1720
1721 for {
1722 t := v.Type
1723 sym := auxToSym(v.Aux)
1724 base := v_0
1725 if !(!t.Elem().HasPointers()) {
1726 break
1727 }
1728 v.reset(OpWasmLoweredAddr)
1729 v.Aux = symToAux(sym)
1730 v.AddArg(base)
1731 return true
1732 }
1733 return false
1734 }
1735 func rewriteValueWasm_OpLsh16x16(v *Value) bool {
1736 v_1 := v.Args[1]
1737 v_0 := v.Args[0]
1738 b := v.Block
1739 typ := &b.Func.Config.Types
1740
1741
1742 for {
1743 c := auxIntToBool(v.AuxInt)
1744 x := v_0
1745 y := v_1
1746 v.reset(OpLsh64x64)
1747 v.AuxInt = boolToAuxInt(c)
1748 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1749 v0.AddArg(y)
1750 v.AddArg2(x, v0)
1751 return true
1752 }
1753 }
1754 func rewriteValueWasm_OpLsh16x32(v *Value) bool {
1755 v_1 := v.Args[1]
1756 v_0 := v.Args[0]
1757 b := v.Block
1758 typ := &b.Func.Config.Types
1759
1760
1761 for {
1762 c := auxIntToBool(v.AuxInt)
1763 x := v_0
1764 y := v_1
1765 v.reset(OpLsh64x64)
1766 v.AuxInt = boolToAuxInt(c)
1767 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1768 v0.AddArg(y)
1769 v.AddArg2(x, v0)
1770 return true
1771 }
1772 }
1773 func rewriteValueWasm_OpLsh16x8(v *Value) bool {
1774 v_1 := v.Args[1]
1775 v_0 := v.Args[0]
1776 b := v.Block
1777 typ := &b.Func.Config.Types
1778
1779
1780 for {
1781 c := auxIntToBool(v.AuxInt)
1782 x := v_0
1783 y := v_1
1784 v.reset(OpLsh64x64)
1785 v.AuxInt = boolToAuxInt(c)
1786 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1787 v0.AddArg(y)
1788 v.AddArg2(x, v0)
1789 return true
1790 }
1791 }
1792 func rewriteValueWasm_OpLsh32x16(v *Value) bool {
1793 v_1 := v.Args[1]
1794 v_0 := v.Args[0]
1795 b := v.Block
1796 typ := &b.Func.Config.Types
1797
1798
1799 for {
1800 c := auxIntToBool(v.AuxInt)
1801 x := v_0
1802 y := v_1
1803 v.reset(OpLsh64x64)
1804 v.AuxInt = boolToAuxInt(c)
1805 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1806 v0.AddArg(y)
1807 v.AddArg2(x, v0)
1808 return true
1809 }
1810 }
1811 func rewriteValueWasm_OpLsh32x32(v *Value) bool {
1812 v_1 := v.Args[1]
1813 v_0 := v.Args[0]
1814 b := v.Block
1815 typ := &b.Func.Config.Types
1816
1817
1818 for {
1819 c := auxIntToBool(v.AuxInt)
1820 x := v_0
1821 y := v_1
1822 v.reset(OpLsh64x64)
1823 v.AuxInt = boolToAuxInt(c)
1824 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1825 v0.AddArg(y)
1826 v.AddArg2(x, v0)
1827 return true
1828 }
1829 }
1830 func rewriteValueWasm_OpLsh32x8(v *Value) bool {
1831 v_1 := v.Args[1]
1832 v_0 := v.Args[0]
1833 b := v.Block
1834 typ := &b.Func.Config.Types
1835
1836
1837 for {
1838 c := auxIntToBool(v.AuxInt)
1839 x := v_0
1840 y := v_1
1841 v.reset(OpLsh64x64)
1842 v.AuxInt = boolToAuxInt(c)
1843 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1844 v0.AddArg(y)
1845 v.AddArg2(x, v0)
1846 return true
1847 }
1848 }
1849 func rewriteValueWasm_OpLsh64x16(v *Value) bool {
1850 v_1 := v.Args[1]
1851 v_0 := v.Args[0]
1852 b := v.Block
1853 typ := &b.Func.Config.Types
1854
1855
1856 for {
1857 c := auxIntToBool(v.AuxInt)
1858 x := v_0
1859 y := v_1
1860 v.reset(OpLsh64x64)
1861 v.AuxInt = boolToAuxInt(c)
1862 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1863 v0.AddArg(y)
1864 v.AddArg2(x, v0)
1865 return true
1866 }
1867 }
1868 func rewriteValueWasm_OpLsh64x32(v *Value) bool {
1869 v_1 := v.Args[1]
1870 v_0 := v.Args[0]
1871 b := v.Block
1872 typ := &b.Func.Config.Types
1873
1874
1875 for {
1876 c := auxIntToBool(v.AuxInt)
1877 x := v_0
1878 y := v_1
1879 v.reset(OpLsh64x64)
1880 v.AuxInt = boolToAuxInt(c)
1881 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1882 v0.AddArg(y)
1883 v.AddArg2(x, v0)
1884 return true
1885 }
1886 }
1887 func rewriteValueWasm_OpLsh64x64(v *Value) bool {
1888 v_1 := v.Args[1]
1889 v_0 := v.Args[0]
1890 b := v.Block
1891 typ := &b.Func.Config.Types
1892
1893
1894
1895 for {
1896 x := v_0
1897 y := v_1
1898 if !(shiftIsBounded(v)) {
1899 break
1900 }
1901 v.reset(OpWasmI64Shl)
1902 v.AddArg2(x, y)
1903 return true
1904 }
1905
1906
1907
1908 for {
1909 x := v_0
1910 if v_1.Op != OpWasmI64Const {
1911 break
1912 }
1913 c := auxIntToInt64(v_1.AuxInt)
1914 if !(uint64(c) < 64) {
1915 break
1916 }
1917 v.reset(OpWasmI64Shl)
1918 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
1919 v0.AuxInt = int64ToAuxInt(c)
1920 v.AddArg2(x, v0)
1921 return true
1922 }
1923
1924
1925
1926 for {
1927 if v_1.Op != OpWasmI64Const {
1928 break
1929 }
1930 c := auxIntToInt64(v_1.AuxInt)
1931 if !(uint64(c) >= 64) {
1932 break
1933 }
1934 v.reset(OpWasmI64Const)
1935 v.AuxInt = int64ToAuxInt(0)
1936 return true
1937 }
1938
1939
1940 for {
1941 x := v_0
1942 y := v_1
1943 v.reset(OpWasmSelect)
1944 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64)
1945 v0.AddArg2(x, y)
1946 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
1947 v1.AuxInt = int64ToAuxInt(0)
1948 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
1949 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
1950 v3.AuxInt = int64ToAuxInt(64)
1951 v2.AddArg2(y, v3)
1952 v.AddArg3(v0, v1, v2)
1953 return true
1954 }
1955 }
1956 func rewriteValueWasm_OpLsh64x8(v *Value) bool {
1957 v_1 := v.Args[1]
1958 v_0 := v.Args[0]
1959 b := v.Block
1960 typ := &b.Func.Config.Types
1961
1962
1963 for {
1964 c := auxIntToBool(v.AuxInt)
1965 x := v_0
1966 y := v_1
1967 v.reset(OpLsh64x64)
1968 v.AuxInt = boolToAuxInt(c)
1969 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1970 v0.AddArg(y)
1971 v.AddArg2(x, v0)
1972 return true
1973 }
1974 }
1975 func rewriteValueWasm_OpLsh8x16(v *Value) bool {
1976 v_1 := v.Args[1]
1977 v_0 := v.Args[0]
1978 b := v.Block
1979 typ := &b.Func.Config.Types
1980
1981
1982 for {
1983 c := auxIntToBool(v.AuxInt)
1984 x := v_0
1985 y := v_1
1986 v.reset(OpLsh64x64)
1987 v.AuxInt = boolToAuxInt(c)
1988 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1989 v0.AddArg(y)
1990 v.AddArg2(x, v0)
1991 return true
1992 }
1993 }
1994 func rewriteValueWasm_OpLsh8x32(v *Value) bool {
1995 v_1 := v.Args[1]
1996 v_0 := v.Args[0]
1997 b := v.Block
1998 typ := &b.Func.Config.Types
1999
2000
2001 for {
2002 c := auxIntToBool(v.AuxInt)
2003 x := v_0
2004 y := v_1
2005 v.reset(OpLsh64x64)
2006 v.AuxInt = boolToAuxInt(c)
2007 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2008 v0.AddArg(y)
2009 v.AddArg2(x, v0)
2010 return true
2011 }
2012 }
2013 func rewriteValueWasm_OpLsh8x8(v *Value) bool {
2014 v_1 := v.Args[1]
2015 v_0 := v.Args[0]
2016 b := v.Block
2017 typ := &b.Func.Config.Types
2018
2019
2020 for {
2021 c := auxIntToBool(v.AuxInt)
2022 x := v_0
2023 y := v_1
2024 v.reset(OpLsh64x64)
2025 v.AuxInt = boolToAuxInt(c)
2026 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2027 v0.AddArg(y)
2028 v.AddArg2(x, v0)
2029 return true
2030 }
2031 }
2032 func rewriteValueWasm_OpMod16(v *Value) bool {
2033 v_1 := v.Args[1]
2034 v_0 := v.Args[0]
2035 b := v.Block
2036 typ := &b.Func.Config.Types
2037
2038
2039 for {
2040 if auxIntToBool(v.AuxInt) != false {
2041 break
2042 }
2043 x := v_0
2044 y := v_1
2045 v.reset(OpWasmI64RemS)
2046 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2047 v0.AddArg(x)
2048 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2049 v1.AddArg(y)
2050 v.AddArg2(v0, v1)
2051 return true
2052 }
2053 return false
2054 }
2055 func rewriteValueWasm_OpMod16u(v *Value) bool {
2056 v_1 := v.Args[1]
2057 v_0 := v.Args[0]
2058 b := v.Block
2059 typ := &b.Func.Config.Types
2060
2061
2062 for {
2063 x := v_0
2064 y := v_1
2065 v.reset(OpWasmI64RemU)
2066 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2067 v0.AddArg(x)
2068 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2069 v1.AddArg(y)
2070 v.AddArg2(v0, v1)
2071 return true
2072 }
2073 }
2074 func rewriteValueWasm_OpMod32(v *Value) bool {
2075 v_1 := v.Args[1]
2076 v_0 := v.Args[0]
2077 b := v.Block
2078 typ := &b.Func.Config.Types
2079
2080
2081 for {
2082 if auxIntToBool(v.AuxInt) != false {
2083 break
2084 }
2085 x := v_0
2086 y := v_1
2087 v.reset(OpWasmI64RemS)
2088 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2089 v0.AddArg(x)
2090 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2091 v1.AddArg(y)
2092 v.AddArg2(v0, v1)
2093 return true
2094 }
2095 return false
2096 }
2097 func rewriteValueWasm_OpMod32u(v *Value) bool {
2098 v_1 := v.Args[1]
2099 v_0 := v.Args[0]
2100 b := v.Block
2101 typ := &b.Func.Config.Types
2102
2103
2104 for {
2105 x := v_0
2106 y := v_1
2107 v.reset(OpWasmI64RemU)
2108 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2109 v0.AddArg(x)
2110 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2111 v1.AddArg(y)
2112 v.AddArg2(v0, v1)
2113 return true
2114 }
2115 }
2116 func rewriteValueWasm_OpMod64(v *Value) bool {
2117 v_1 := v.Args[1]
2118 v_0 := v.Args[0]
2119
2120
2121 for {
2122 if auxIntToBool(v.AuxInt) != false {
2123 break
2124 }
2125 x := v_0
2126 y := v_1
2127 v.reset(OpWasmI64RemS)
2128 v.AddArg2(x, y)
2129 return true
2130 }
2131 return false
2132 }
2133 func rewriteValueWasm_OpMod8(v *Value) bool {
2134 v_1 := v.Args[1]
2135 v_0 := v.Args[0]
2136 b := v.Block
2137 typ := &b.Func.Config.Types
2138
2139
2140 for {
2141 x := v_0
2142 y := v_1
2143 v.reset(OpWasmI64RemS)
2144 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
2145 v0.AddArg(x)
2146 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
2147 v1.AddArg(y)
2148 v.AddArg2(v0, v1)
2149 return true
2150 }
2151 }
2152 func rewriteValueWasm_OpMod8u(v *Value) bool {
2153 v_1 := v.Args[1]
2154 v_0 := v.Args[0]
2155 b := v.Block
2156 typ := &b.Func.Config.Types
2157
2158
2159 for {
2160 x := v_0
2161 y := v_1
2162 v.reset(OpWasmI64RemU)
2163 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2164 v0.AddArg(x)
2165 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2166 v1.AddArg(y)
2167 v.AddArg2(v0, v1)
2168 return true
2169 }
2170 }
2171 func rewriteValueWasm_OpMove(v *Value) bool {
2172 v_2 := v.Args[2]
2173 v_1 := v.Args[1]
2174 v_0 := v.Args[0]
2175 b := v.Block
2176 typ := &b.Func.Config.Types
2177
2178
2179 for {
2180 if auxIntToInt64(v.AuxInt) != 0 {
2181 break
2182 }
2183 mem := v_2
2184 v.copyOf(mem)
2185 return true
2186 }
2187
2188
2189 for {
2190 if auxIntToInt64(v.AuxInt) != 1 {
2191 break
2192 }
2193 dst := v_0
2194 src := v_1
2195 mem := v_2
2196 v.reset(OpWasmI64Store8)
2197 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
2198 v0.AddArg2(src, mem)
2199 v.AddArg3(dst, v0, mem)
2200 return true
2201 }
2202
2203
2204 for {
2205 if auxIntToInt64(v.AuxInt) != 2 {
2206 break
2207 }
2208 dst := v_0
2209 src := v_1
2210 mem := v_2
2211 v.reset(OpWasmI64Store16)
2212 v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
2213 v0.AddArg2(src, mem)
2214 v.AddArg3(dst, v0, mem)
2215 return true
2216 }
2217
2218
2219 for {
2220 if auxIntToInt64(v.AuxInt) != 4 {
2221 break
2222 }
2223 dst := v_0
2224 src := v_1
2225 mem := v_2
2226 v.reset(OpWasmI64Store32)
2227 v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
2228 v0.AddArg2(src, mem)
2229 v.AddArg3(dst, v0, mem)
2230 return true
2231 }
2232
2233
2234 for {
2235 if auxIntToInt64(v.AuxInt) != 8 {
2236 break
2237 }
2238 dst := v_0
2239 src := v_1
2240 mem := v_2
2241 v.reset(OpWasmI64Store)
2242 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
2243 v0.AddArg2(src, mem)
2244 v.AddArg3(dst, v0, mem)
2245 return true
2246 }
2247
2248
2249 for {
2250 if auxIntToInt64(v.AuxInt) != 16 {
2251 break
2252 }
2253 dst := v_0
2254 src := v_1
2255 mem := v_2
2256 v.reset(OpWasmI64Store)
2257 v.AuxInt = int64ToAuxInt(8)
2258 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
2259 v0.AuxInt = int64ToAuxInt(8)
2260 v0.AddArg2(src, mem)
2261 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
2262 v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
2263 v2.AddArg2(src, mem)
2264 v1.AddArg3(dst, v2, mem)
2265 v.AddArg3(dst, v0, v1)
2266 return true
2267 }
2268
2269
2270 for {
2271 if auxIntToInt64(v.AuxInt) != 3 {
2272 break
2273 }
2274 dst := v_0
2275 src := v_1
2276 mem := v_2
2277 v.reset(OpWasmI64Store8)
2278 v.AuxInt = int64ToAuxInt(2)
2279 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
2280 v0.AuxInt = int64ToAuxInt(2)
2281 v0.AddArg2(src, mem)
2282 v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem)
2283 v2 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
2284 v2.AddArg2(src, mem)
2285 v1.AddArg3(dst, v2, mem)
2286 v.AddArg3(dst, v0, v1)
2287 return true
2288 }
2289
2290
2291 for {
2292 if auxIntToInt64(v.AuxInt) != 5 {
2293 break
2294 }
2295 dst := v_0
2296 src := v_1
2297 mem := v_2
2298 v.reset(OpWasmI64Store8)
2299 v.AuxInt = int64ToAuxInt(4)
2300 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8)
2301 v0.AuxInt = int64ToAuxInt(4)
2302 v0.AddArg2(src, mem)
2303 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
2304 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
2305 v2.AddArg2(src, mem)
2306 v1.AddArg3(dst, v2, mem)
2307 v.AddArg3(dst, v0, v1)
2308 return true
2309 }
2310
2311
2312 for {
2313 if auxIntToInt64(v.AuxInt) != 6 {
2314 break
2315 }
2316 dst := v_0
2317 src := v_1
2318 mem := v_2
2319 v.reset(OpWasmI64Store16)
2320 v.AuxInt = int64ToAuxInt(4)
2321 v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16)
2322 v0.AuxInt = int64ToAuxInt(4)
2323 v0.AddArg2(src, mem)
2324 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
2325 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
2326 v2.AddArg2(src, mem)
2327 v1.AddArg3(dst, v2, mem)
2328 v.AddArg3(dst, v0, v1)
2329 return true
2330 }
2331
2332
2333 for {
2334 if auxIntToInt64(v.AuxInt) != 7 {
2335 break
2336 }
2337 dst := v_0
2338 src := v_1
2339 mem := v_2
2340 v.reset(OpWasmI64Store32)
2341 v.AuxInt = int64ToAuxInt(3)
2342 v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
2343 v0.AuxInt = int64ToAuxInt(3)
2344 v0.AddArg2(src, mem)
2345 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
2346 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32)
2347 v2.AddArg2(src, mem)
2348 v1.AddArg3(dst, v2, mem)
2349 v.AddArg3(dst, v0, v1)
2350 return true
2351 }
2352
2353
2354
2355 for {
2356 s := auxIntToInt64(v.AuxInt)
2357 dst := v_0
2358 src := v_1
2359 mem := v_2
2360 if !(s > 8 && s < 16) {
2361 break
2362 }
2363 v.reset(OpWasmI64Store)
2364 v.AuxInt = int64ToAuxInt(s - 8)
2365 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
2366 v0.AuxInt = int64ToAuxInt(s - 8)
2367 v0.AddArg2(src, mem)
2368 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
2369 v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64)
2370 v2.AddArg2(src, mem)
2371 v1.AddArg3(dst, v2, mem)
2372 v.AddArg3(dst, v0, v1)
2373 return true
2374 }
2375
2376
2377
2378 for {
2379 s := auxIntToInt64(v.AuxInt)
2380 dst := v_0
2381 src := v_1
2382 mem := v_2
2383 if !(logLargeCopy(v, s)) {
2384 break
2385 }
2386 v.reset(OpWasmLoweredMove)
2387 v.AuxInt = int64ToAuxInt(s)
2388 v.AddArg3(dst, src, mem)
2389 return true
2390 }
2391 return false
2392 }
2393 func rewriteValueWasm_OpNeg16(v *Value) bool {
2394 v_0 := v.Args[0]
2395 b := v.Block
2396 typ := &b.Func.Config.Types
2397
2398
2399 for {
2400 x := v_0
2401 v.reset(OpWasmI64Sub)
2402 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2403 v0.AuxInt = int64ToAuxInt(0)
2404 v.AddArg2(v0, x)
2405 return true
2406 }
2407 }
2408 func rewriteValueWasm_OpNeg32(v *Value) bool {
2409 v_0 := v.Args[0]
2410 b := v.Block
2411 typ := &b.Func.Config.Types
2412
2413
2414 for {
2415 x := v_0
2416 v.reset(OpWasmI64Sub)
2417 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2418 v0.AuxInt = int64ToAuxInt(0)
2419 v.AddArg2(v0, x)
2420 return true
2421 }
2422 }
2423 func rewriteValueWasm_OpNeg64(v *Value) bool {
2424 v_0 := v.Args[0]
2425 b := v.Block
2426 typ := &b.Func.Config.Types
2427
2428
2429 for {
2430 x := v_0
2431 v.reset(OpWasmI64Sub)
2432 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2433 v0.AuxInt = int64ToAuxInt(0)
2434 v.AddArg2(v0, x)
2435 return true
2436 }
2437 }
2438 func rewriteValueWasm_OpNeg8(v *Value) bool {
2439 v_0 := v.Args[0]
2440 b := v.Block
2441 typ := &b.Func.Config.Types
2442
2443
2444 for {
2445 x := v_0
2446 v.reset(OpWasmI64Sub)
2447 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2448 v0.AuxInt = int64ToAuxInt(0)
2449 v.AddArg2(v0, x)
2450 return true
2451 }
2452 }
2453 func rewriteValueWasm_OpNeq16(v *Value) bool {
2454 v_1 := v.Args[1]
2455 v_0 := v.Args[0]
2456 b := v.Block
2457 typ := &b.Func.Config.Types
2458
2459
2460 for {
2461 x := v_0
2462 y := v_1
2463 v.reset(OpWasmI64Ne)
2464 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2465 v0.AddArg(x)
2466 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2467 v1.AddArg(y)
2468 v.AddArg2(v0, v1)
2469 return true
2470 }
2471 }
2472 func rewriteValueWasm_OpNeq32(v *Value) bool {
2473 v_1 := v.Args[1]
2474 v_0 := v.Args[0]
2475 b := v.Block
2476 typ := &b.Func.Config.Types
2477
2478
2479 for {
2480 x := v_0
2481 y := v_1
2482 v.reset(OpWasmI64Ne)
2483 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2484 v0.AddArg(x)
2485 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2486 v1.AddArg(y)
2487 v.AddArg2(v0, v1)
2488 return true
2489 }
2490 }
2491 func rewriteValueWasm_OpNeq8(v *Value) bool {
2492 v_1 := v.Args[1]
2493 v_0 := v.Args[0]
2494 b := v.Block
2495 typ := &b.Func.Config.Types
2496
2497
2498 for {
2499 x := v_0
2500 y := v_1
2501 v.reset(OpWasmI64Ne)
2502 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2503 v0.AddArg(x)
2504 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2505 v1.AddArg(y)
2506 v.AddArg2(v0, v1)
2507 return true
2508 }
2509 }
2510 func rewriteValueWasm_OpPopCount16(v *Value) bool {
2511 v_0 := v.Args[0]
2512 b := v.Block
2513 typ := &b.Func.Config.Types
2514
2515
2516 for {
2517 x := v_0
2518 v.reset(OpWasmI64Popcnt)
2519 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2520 v0.AddArg(x)
2521 v.AddArg(v0)
2522 return true
2523 }
2524 }
2525 func rewriteValueWasm_OpPopCount32(v *Value) bool {
2526 v_0 := v.Args[0]
2527 b := v.Block
2528 typ := &b.Func.Config.Types
2529
2530
2531 for {
2532 x := v_0
2533 v.reset(OpWasmI64Popcnt)
2534 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2535 v0.AddArg(x)
2536 v.AddArg(v0)
2537 return true
2538 }
2539 }
2540 func rewriteValueWasm_OpPopCount8(v *Value) bool {
2541 v_0 := v.Args[0]
2542 b := v.Block
2543 typ := &b.Func.Config.Types
2544
2545
2546 for {
2547 x := v_0
2548 v.reset(OpWasmI64Popcnt)
2549 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2550 v0.AddArg(x)
2551 v.AddArg(v0)
2552 return true
2553 }
2554 }
2555 func rewriteValueWasm_OpRotateLeft16(v *Value) bool {
2556 v_1 := v.Args[1]
2557 v_0 := v.Args[0]
2558 b := v.Block
2559 typ := &b.Func.Config.Types
2560
2561
2562 for {
2563 t := v.Type
2564 x := v_0
2565 if v_1.Op != OpWasmI64Const {
2566 break
2567 }
2568 c := auxIntToInt64(v_1.AuxInt)
2569 v.reset(OpOr16)
2570 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
2571 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2572 v1.AuxInt = int64ToAuxInt(c & 15)
2573 v0.AddArg2(x, v1)
2574 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
2575 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2576 v3.AuxInt = int64ToAuxInt(-c & 15)
2577 v2.AddArg2(x, v3)
2578 v.AddArg2(v0, v2)
2579 return true
2580 }
2581 return false
2582 }
2583 func rewriteValueWasm_OpRotateLeft8(v *Value) bool {
2584 v_1 := v.Args[1]
2585 v_0 := v.Args[0]
2586 b := v.Block
2587 typ := &b.Func.Config.Types
2588
2589
2590 for {
2591 t := v.Type
2592 x := v_0
2593 if v_1.Op != OpWasmI64Const {
2594 break
2595 }
2596 c := auxIntToInt64(v_1.AuxInt)
2597 v.reset(OpOr8)
2598 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
2599 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2600 v1.AuxInt = int64ToAuxInt(c & 7)
2601 v0.AddArg2(x, v1)
2602 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
2603 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
2604 v3.AuxInt = int64ToAuxInt(-c & 7)
2605 v2.AddArg2(x, v3)
2606 v.AddArg2(v0, v2)
2607 return true
2608 }
2609 return false
2610 }
2611 func rewriteValueWasm_OpRsh16Ux16(v *Value) bool {
2612 v_1 := v.Args[1]
2613 v_0 := v.Args[0]
2614 b := v.Block
2615 typ := &b.Func.Config.Types
2616
2617
2618 for {
2619 c := auxIntToBool(v.AuxInt)
2620 x := v_0
2621 y := v_1
2622 v.reset(OpRsh64Ux64)
2623 v.AuxInt = boolToAuxInt(c)
2624 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2625 v0.AddArg(x)
2626 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2627 v1.AddArg(y)
2628 v.AddArg2(v0, v1)
2629 return true
2630 }
2631 }
2632 func rewriteValueWasm_OpRsh16Ux32(v *Value) bool {
2633 v_1 := v.Args[1]
2634 v_0 := v.Args[0]
2635 b := v.Block
2636 typ := &b.Func.Config.Types
2637
2638
2639 for {
2640 c := auxIntToBool(v.AuxInt)
2641 x := v_0
2642 y := v_1
2643 v.reset(OpRsh64Ux64)
2644 v.AuxInt = boolToAuxInt(c)
2645 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2646 v0.AddArg(x)
2647 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2648 v1.AddArg(y)
2649 v.AddArg2(v0, v1)
2650 return true
2651 }
2652 }
2653 func rewriteValueWasm_OpRsh16Ux64(v *Value) bool {
2654 v_1 := v.Args[1]
2655 v_0 := v.Args[0]
2656 b := v.Block
2657 typ := &b.Func.Config.Types
2658
2659
2660 for {
2661 c := auxIntToBool(v.AuxInt)
2662 x := v_0
2663 y := v_1
2664 v.reset(OpRsh64Ux64)
2665 v.AuxInt = boolToAuxInt(c)
2666 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2667 v0.AddArg(x)
2668 v.AddArg2(v0, y)
2669 return true
2670 }
2671 }
2672 func rewriteValueWasm_OpRsh16Ux8(v *Value) bool {
2673 v_1 := v.Args[1]
2674 v_0 := v.Args[0]
2675 b := v.Block
2676 typ := &b.Func.Config.Types
2677
2678
2679 for {
2680 c := auxIntToBool(v.AuxInt)
2681 x := v_0
2682 y := v_1
2683 v.reset(OpRsh64Ux64)
2684 v.AuxInt = boolToAuxInt(c)
2685 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2686 v0.AddArg(x)
2687 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2688 v1.AddArg(y)
2689 v.AddArg2(v0, v1)
2690 return true
2691 }
2692 }
2693 func rewriteValueWasm_OpRsh16x16(v *Value) bool {
2694 v_1 := v.Args[1]
2695 v_0 := v.Args[0]
2696 b := v.Block
2697 typ := &b.Func.Config.Types
2698
2699
2700 for {
2701 c := auxIntToBool(v.AuxInt)
2702 x := v_0
2703 y := v_1
2704 v.reset(OpRsh64x64)
2705 v.AuxInt = boolToAuxInt(c)
2706 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2707 v0.AddArg(x)
2708 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2709 v1.AddArg(y)
2710 v.AddArg2(v0, v1)
2711 return true
2712 }
2713 }
2714 func rewriteValueWasm_OpRsh16x32(v *Value) bool {
2715 v_1 := v.Args[1]
2716 v_0 := v.Args[0]
2717 b := v.Block
2718 typ := &b.Func.Config.Types
2719
2720
2721 for {
2722 c := auxIntToBool(v.AuxInt)
2723 x := v_0
2724 y := v_1
2725 v.reset(OpRsh64x64)
2726 v.AuxInt = boolToAuxInt(c)
2727 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2728 v0.AddArg(x)
2729 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2730 v1.AddArg(y)
2731 v.AddArg2(v0, v1)
2732 return true
2733 }
2734 }
2735 func rewriteValueWasm_OpRsh16x64(v *Value) bool {
2736 v_1 := v.Args[1]
2737 v_0 := v.Args[0]
2738 b := v.Block
2739 typ := &b.Func.Config.Types
2740
2741
2742 for {
2743 c := auxIntToBool(v.AuxInt)
2744 x := v_0
2745 y := v_1
2746 v.reset(OpRsh64x64)
2747 v.AuxInt = boolToAuxInt(c)
2748 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2749 v0.AddArg(x)
2750 v.AddArg2(v0, y)
2751 return true
2752 }
2753 }
2754 func rewriteValueWasm_OpRsh16x8(v *Value) bool {
2755 v_1 := v.Args[1]
2756 v_0 := v.Args[0]
2757 b := v.Block
2758 typ := &b.Func.Config.Types
2759
2760
2761 for {
2762 c := auxIntToBool(v.AuxInt)
2763 x := v_0
2764 y := v_1
2765 v.reset(OpRsh64x64)
2766 v.AuxInt = boolToAuxInt(c)
2767 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
2768 v0.AddArg(x)
2769 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2770 v1.AddArg(y)
2771 v.AddArg2(v0, v1)
2772 return true
2773 }
2774 }
2775 func rewriteValueWasm_OpRsh32Ux16(v *Value) bool {
2776 v_1 := v.Args[1]
2777 v_0 := v.Args[0]
2778 b := v.Block
2779 typ := &b.Func.Config.Types
2780
2781
2782 for {
2783 c := auxIntToBool(v.AuxInt)
2784 x := v_0
2785 y := v_1
2786 v.reset(OpRsh64Ux64)
2787 v.AuxInt = boolToAuxInt(c)
2788 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2789 v0.AddArg(x)
2790 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2791 v1.AddArg(y)
2792 v.AddArg2(v0, v1)
2793 return true
2794 }
2795 }
2796 func rewriteValueWasm_OpRsh32Ux32(v *Value) bool {
2797 v_1 := v.Args[1]
2798 v_0 := v.Args[0]
2799 b := v.Block
2800 typ := &b.Func.Config.Types
2801
2802
2803 for {
2804 c := auxIntToBool(v.AuxInt)
2805 x := v_0
2806 y := v_1
2807 v.reset(OpRsh64Ux64)
2808 v.AuxInt = boolToAuxInt(c)
2809 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2810 v0.AddArg(x)
2811 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2812 v1.AddArg(y)
2813 v.AddArg2(v0, v1)
2814 return true
2815 }
2816 }
2817 func rewriteValueWasm_OpRsh32Ux64(v *Value) bool {
2818 v_1 := v.Args[1]
2819 v_0 := v.Args[0]
2820 b := v.Block
2821 typ := &b.Func.Config.Types
2822
2823
2824 for {
2825 c := auxIntToBool(v.AuxInt)
2826 x := v_0
2827 y := v_1
2828 v.reset(OpRsh64Ux64)
2829 v.AuxInt = boolToAuxInt(c)
2830 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2831 v0.AddArg(x)
2832 v.AddArg2(v0, y)
2833 return true
2834 }
2835 }
2836 func rewriteValueWasm_OpRsh32Ux8(v *Value) bool {
2837 v_1 := v.Args[1]
2838 v_0 := v.Args[0]
2839 b := v.Block
2840 typ := &b.Func.Config.Types
2841
2842
2843 for {
2844 c := auxIntToBool(v.AuxInt)
2845 x := v_0
2846 y := v_1
2847 v.reset(OpRsh64Ux64)
2848 v.AuxInt = boolToAuxInt(c)
2849 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2850 v0.AddArg(x)
2851 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2852 v1.AddArg(y)
2853 v.AddArg2(v0, v1)
2854 return true
2855 }
2856 }
2857 func rewriteValueWasm_OpRsh32x16(v *Value) bool {
2858 v_1 := v.Args[1]
2859 v_0 := v.Args[0]
2860 b := v.Block
2861 typ := &b.Func.Config.Types
2862
2863
2864 for {
2865 c := auxIntToBool(v.AuxInt)
2866 x := v_0
2867 y := v_1
2868 v.reset(OpRsh64x64)
2869 v.AuxInt = boolToAuxInt(c)
2870 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2871 v0.AddArg(x)
2872 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2873 v1.AddArg(y)
2874 v.AddArg2(v0, v1)
2875 return true
2876 }
2877 }
2878 func rewriteValueWasm_OpRsh32x32(v *Value) bool {
2879 v_1 := v.Args[1]
2880 v_0 := v.Args[0]
2881 b := v.Block
2882 typ := &b.Func.Config.Types
2883
2884
2885 for {
2886 c := auxIntToBool(v.AuxInt)
2887 x := v_0
2888 y := v_1
2889 v.reset(OpRsh64x64)
2890 v.AuxInt = boolToAuxInt(c)
2891 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2892 v0.AddArg(x)
2893 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2894 v1.AddArg(y)
2895 v.AddArg2(v0, v1)
2896 return true
2897 }
2898 }
2899 func rewriteValueWasm_OpRsh32x64(v *Value) bool {
2900 v_1 := v.Args[1]
2901 v_0 := v.Args[0]
2902 b := v.Block
2903 typ := &b.Func.Config.Types
2904
2905
2906 for {
2907 c := auxIntToBool(v.AuxInt)
2908 x := v_0
2909 y := v_1
2910 v.reset(OpRsh64x64)
2911 v.AuxInt = boolToAuxInt(c)
2912 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2913 v0.AddArg(x)
2914 v.AddArg2(v0, y)
2915 return true
2916 }
2917 }
2918 func rewriteValueWasm_OpRsh32x8(v *Value) bool {
2919 v_1 := v.Args[1]
2920 v_0 := v.Args[0]
2921 b := v.Block
2922 typ := &b.Func.Config.Types
2923
2924
2925 for {
2926 c := auxIntToBool(v.AuxInt)
2927 x := v_0
2928 y := v_1
2929 v.reset(OpRsh64x64)
2930 v.AuxInt = boolToAuxInt(c)
2931 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
2932 v0.AddArg(x)
2933 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2934 v1.AddArg(y)
2935 v.AddArg2(v0, v1)
2936 return true
2937 }
2938 }
2939 func rewriteValueWasm_OpRsh64Ux16(v *Value) bool {
2940 v_1 := v.Args[1]
2941 v_0 := v.Args[0]
2942 b := v.Block
2943 typ := &b.Func.Config.Types
2944
2945
2946 for {
2947 c := auxIntToBool(v.AuxInt)
2948 x := v_0
2949 y := v_1
2950 v.reset(OpRsh64Ux64)
2951 v.AuxInt = boolToAuxInt(c)
2952 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2953 v0.AddArg(y)
2954 v.AddArg2(x, v0)
2955 return true
2956 }
2957 }
2958 func rewriteValueWasm_OpRsh64Ux32(v *Value) bool {
2959 v_1 := v.Args[1]
2960 v_0 := v.Args[0]
2961 b := v.Block
2962 typ := &b.Func.Config.Types
2963
2964
2965 for {
2966 c := auxIntToBool(v.AuxInt)
2967 x := v_0
2968 y := v_1
2969 v.reset(OpRsh64Ux64)
2970 v.AuxInt = boolToAuxInt(c)
2971 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2972 v0.AddArg(y)
2973 v.AddArg2(x, v0)
2974 return true
2975 }
2976 }
2977 func rewriteValueWasm_OpRsh64Ux64(v *Value) bool {
2978 v_1 := v.Args[1]
2979 v_0 := v.Args[0]
2980 b := v.Block
2981 typ := &b.Func.Config.Types
2982
2983
2984
2985 for {
2986 x := v_0
2987 y := v_1
2988 if !(shiftIsBounded(v)) {
2989 break
2990 }
2991 v.reset(OpWasmI64ShrU)
2992 v.AddArg2(x, y)
2993 return true
2994 }
2995
2996
2997
2998 for {
2999 x := v_0
3000 if v_1.Op != OpWasmI64Const {
3001 break
3002 }
3003 c := auxIntToInt64(v_1.AuxInt)
3004 if !(uint64(c) < 64) {
3005 break
3006 }
3007 v.reset(OpWasmI64ShrU)
3008 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3009 v0.AuxInt = int64ToAuxInt(c)
3010 v.AddArg2(x, v0)
3011 return true
3012 }
3013
3014
3015
3016 for {
3017 if v_1.Op != OpWasmI64Const {
3018 break
3019 }
3020 c := auxIntToInt64(v_1.AuxInt)
3021 if !(uint64(c) >= 64) {
3022 break
3023 }
3024 v.reset(OpWasmI64Const)
3025 v.AuxInt = int64ToAuxInt(0)
3026 return true
3027 }
3028
3029
3030 for {
3031 x := v_0
3032 y := v_1
3033 v.reset(OpWasmSelect)
3034 v0 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64)
3035 v0.AddArg2(x, y)
3036 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3037 v1.AuxInt = int64ToAuxInt(0)
3038 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
3039 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3040 v3.AuxInt = int64ToAuxInt(64)
3041 v2.AddArg2(y, v3)
3042 v.AddArg3(v0, v1, v2)
3043 return true
3044 }
3045 }
3046 func rewriteValueWasm_OpRsh64Ux8(v *Value) bool {
3047 v_1 := v.Args[1]
3048 v_0 := v.Args[0]
3049 b := v.Block
3050 typ := &b.Func.Config.Types
3051
3052
3053 for {
3054 c := auxIntToBool(v.AuxInt)
3055 x := v_0
3056 y := v_1
3057 v.reset(OpRsh64Ux64)
3058 v.AuxInt = boolToAuxInt(c)
3059 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3060 v0.AddArg(y)
3061 v.AddArg2(x, v0)
3062 return true
3063 }
3064 }
3065 func rewriteValueWasm_OpRsh64x16(v *Value) bool {
3066 v_1 := v.Args[1]
3067 v_0 := v.Args[0]
3068 b := v.Block
3069 typ := &b.Func.Config.Types
3070
3071
3072 for {
3073 c := auxIntToBool(v.AuxInt)
3074 x := v_0
3075 y := v_1
3076 v.reset(OpRsh64x64)
3077 v.AuxInt = boolToAuxInt(c)
3078 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
3079 v0.AddArg(y)
3080 v.AddArg2(x, v0)
3081 return true
3082 }
3083 }
3084 func rewriteValueWasm_OpRsh64x32(v *Value) bool {
3085 v_1 := v.Args[1]
3086 v_0 := v.Args[0]
3087 b := v.Block
3088 typ := &b.Func.Config.Types
3089
3090
3091 for {
3092 c := auxIntToBool(v.AuxInt)
3093 x := v_0
3094 y := v_1
3095 v.reset(OpRsh64x64)
3096 v.AuxInt = boolToAuxInt(c)
3097 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
3098 v0.AddArg(y)
3099 v.AddArg2(x, v0)
3100 return true
3101 }
3102 }
3103 func rewriteValueWasm_OpRsh64x64(v *Value) bool {
3104 v_1 := v.Args[1]
3105 v_0 := v.Args[0]
3106 b := v.Block
3107 typ := &b.Func.Config.Types
3108
3109
3110
3111 for {
3112 x := v_0
3113 y := v_1
3114 if !(shiftIsBounded(v)) {
3115 break
3116 }
3117 v.reset(OpWasmI64ShrS)
3118 v.AddArg2(x, y)
3119 return true
3120 }
3121
3122
3123
3124 for {
3125 x := v_0
3126 if v_1.Op != OpWasmI64Const {
3127 break
3128 }
3129 c := auxIntToInt64(v_1.AuxInt)
3130 if !(uint64(c) < 64) {
3131 break
3132 }
3133 v.reset(OpWasmI64ShrS)
3134 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3135 v0.AuxInt = int64ToAuxInt(c)
3136 v.AddArg2(x, v0)
3137 return true
3138 }
3139
3140
3141
3142 for {
3143 x := v_0
3144 if v_1.Op != OpWasmI64Const {
3145 break
3146 }
3147 c := auxIntToInt64(v_1.AuxInt)
3148 if !(uint64(c) >= 64) {
3149 break
3150 }
3151 v.reset(OpWasmI64ShrS)
3152 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3153 v0.AuxInt = int64ToAuxInt(63)
3154 v.AddArg2(x, v0)
3155 return true
3156 }
3157
3158
3159 for {
3160 x := v_0
3161 y := v_1
3162 v.reset(OpWasmI64ShrS)
3163 v0 := b.NewValue0(v.Pos, OpWasmSelect, typ.Int64)
3164 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3165 v1.AuxInt = int64ToAuxInt(63)
3166 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool)
3167 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3168 v3.AuxInt = int64ToAuxInt(64)
3169 v2.AddArg2(y, v3)
3170 v0.AddArg3(y, v1, v2)
3171 v.AddArg2(x, v0)
3172 return true
3173 }
3174 }
3175 func rewriteValueWasm_OpRsh64x8(v *Value) bool {
3176 v_1 := v.Args[1]
3177 v_0 := v.Args[0]
3178 b := v.Block
3179 typ := &b.Func.Config.Types
3180
3181
3182 for {
3183 c := auxIntToBool(v.AuxInt)
3184 x := v_0
3185 y := v_1
3186 v.reset(OpRsh64x64)
3187 v.AuxInt = boolToAuxInt(c)
3188 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3189 v0.AddArg(y)
3190 v.AddArg2(x, v0)
3191 return true
3192 }
3193 }
3194 func rewriteValueWasm_OpRsh8Ux16(v *Value) bool {
3195 v_1 := v.Args[1]
3196 v_0 := v.Args[0]
3197 b := v.Block
3198 typ := &b.Func.Config.Types
3199
3200
3201 for {
3202 c := auxIntToBool(v.AuxInt)
3203 x := v_0
3204 y := v_1
3205 v.reset(OpRsh64Ux64)
3206 v.AuxInt = boolToAuxInt(c)
3207 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3208 v0.AddArg(x)
3209 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
3210 v1.AddArg(y)
3211 v.AddArg2(v0, v1)
3212 return true
3213 }
3214 }
3215 func rewriteValueWasm_OpRsh8Ux32(v *Value) bool {
3216 v_1 := v.Args[1]
3217 v_0 := v.Args[0]
3218 b := v.Block
3219 typ := &b.Func.Config.Types
3220
3221
3222 for {
3223 c := auxIntToBool(v.AuxInt)
3224 x := v_0
3225 y := v_1
3226 v.reset(OpRsh64Ux64)
3227 v.AuxInt = boolToAuxInt(c)
3228 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3229 v0.AddArg(x)
3230 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
3231 v1.AddArg(y)
3232 v.AddArg2(v0, v1)
3233 return true
3234 }
3235 }
3236 func rewriteValueWasm_OpRsh8Ux64(v *Value) bool {
3237 v_1 := v.Args[1]
3238 v_0 := v.Args[0]
3239 b := v.Block
3240 typ := &b.Func.Config.Types
3241
3242
3243 for {
3244 c := auxIntToBool(v.AuxInt)
3245 x := v_0
3246 y := v_1
3247 v.reset(OpRsh64Ux64)
3248 v.AuxInt = boolToAuxInt(c)
3249 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3250 v0.AddArg(x)
3251 v.AddArg2(v0, y)
3252 return true
3253 }
3254 }
3255 func rewriteValueWasm_OpRsh8Ux8(v *Value) bool {
3256 v_1 := v.Args[1]
3257 v_0 := v.Args[0]
3258 b := v.Block
3259 typ := &b.Func.Config.Types
3260
3261
3262 for {
3263 c := auxIntToBool(v.AuxInt)
3264 x := v_0
3265 y := v_1
3266 v.reset(OpRsh64Ux64)
3267 v.AuxInt = boolToAuxInt(c)
3268 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3269 v0.AddArg(x)
3270 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3271 v1.AddArg(y)
3272 v.AddArg2(v0, v1)
3273 return true
3274 }
3275 }
3276 func rewriteValueWasm_OpRsh8x16(v *Value) bool {
3277 v_1 := v.Args[1]
3278 v_0 := v.Args[0]
3279 b := v.Block
3280 typ := &b.Func.Config.Types
3281
3282
3283 for {
3284 c := auxIntToBool(v.AuxInt)
3285 x := v_0
3286 y := v_1
3287 v.reset(OpRsh64x64)
3288 v.AuxInt = boolToAuxInt(c)
3289 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
3290 v0.AddArg(x)
3291 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
3292 v1.AddArg(y)
3293 v.AddArg2(v0, v1)
3294 return true
3295 }
3296 }
3297 func rewriteValueWasm_OpRsh8x32(v *Value) bool {
3298 v_1 := v.Args[1]
3299 v_0 := v.Args[0]
3300 b := v.Block
3301 typ := &b.Func.Config.Types
3302
3303
3304 for {
3305 c := auxIntToBool(v.AuxInt)
3306 x := v_0
3307 y := v_1
3308 v.reset(OpRsh64x64)
3309 v.AuxInt = boolToAuxInt(c)
3310 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
3311 v0.AddArg(x)
3312 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
3313 v1.AddArg(y)
3314 v.AddArg2(v0, v1)
3315 return true
3316 }
3317 }
3318 func rewriteValueWasm_OpRsh8x64(v *Value) bool {
3319 v_1 := v.Args[1]
3320 v_0 := v.Args[0]
3321 b := v.Block
3322 typ := &b.Func.Config.Types
3323
3324
3325 for {
3326 c := auxIntToBool(v.AuxInt)
3327 x := v_0
3328 y := v_1
3329 v.reset(OpRsh64x64)
3330 v.AuxInt = boolToAuxInt(c)
3331 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
3332 v0.AddArg(x)
3333 v.AddArg2(v0, y)
3334 return true
3335 }
3336 }
3337 func rewriteValueWasm_OpRsh8x8(v *Value) bool {
3338 v_1 := v.Args[1]
3339 v_0 := v.Args[0]
3340 b := v.Block
3341 typ := &b.Func.Config.Types
3342
3343
3344 for {
3345 c := auxIntToBool(v.AuxInt)
3346 x := v_0
3347 y := v_1
3348 v.reset(OpRsh64x64)
3349 v.AuxInt = boolToAuxInt(c)
3350 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
3351 v0.AddArg(x)
3352 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3353 v1.AddArg(y)
3354 v.AddArg2(v0, v1)
3355 return true
3356 }
3357 }
3358 func rewriteValueWasm_OpSelect0(v *Value) bool {
3359 v_0 := v.Args[0]
3360
3361
3362 for {
3363 t := v.Type
3364 if v_0.Op != OpMul64uhilo {
3365 break
3366 }
3367 y := v_0.Args[1]
3368 x := v_0.Args[0]
3369 v.reset(OpHmul64u)
3370 v.Type = t
3371 v.AddArg2(x, y)
3372 return true
3373 }
3374 return false
3375 }
3376 func rewriteValueWasm_OpSelect1(v *Value) bool {
3377 v_0 := v.Args[0]
3378
3379
3380 for {
3381 if v_0.Op != OpMul64uhilo {
3382 break
3383 }
3384 y := v_0.Args[1]
3385 x := v_0.Args[0]
3386 v.reset(OpWasmI64Mul)
3387 v.AddArg2(x, y)
3388 return true
3389 }
3390 return false
3391 }
3392 func rewriteValueWasm_OpSignExt16to32(v *Value) bool {
3393 v_0 := v.Args[0]
3394
3395
3396 for {
3397 x := v_0
3398 if x.Op != OpWasmI64Load16S {
3399 break
3400 }
3401 v.copyOf(x)
3402 return true
3403 }
3404
3405
3406 for {
3407 x := v_0
3408 v.reset(OpWasmI64Extend16S)
3409 v.AddArg(x)
3410 return true
3411 }
3412 }
3413 func rewriteValueWasm_OpSignExt16to64(v *Value) bool {
3414 v_0 := v.Args[0]
3415
3416
3417 for {
3418 x := v_0
3419 if x.Op != OpWasmI64Load16S {
3420 break
3421 }
3422 v.copyOf(x)
3423 return true
3424 }
3425
3426
3427 for {
3428 x := v_0
3429 v.reset(OpWasmI64Extend16S)
3430 v.AddArg(x)
3431 return true
3432 }
3433 }
3434 func rewriteValueWasm_OpSignExt32to64(v *Value) bool {
3435 v_0 := v.Args[0]
3436
3437
3438 for {
3439 x := v_0
3440 if x.Op != OpWasmI64Load32S {
3441 break
3442 }
3443 v.copyOf(x)
3444 return true
3445 }
3446
3447
3448 for {
3449 x := v_0
3450 v.reset(OpWasmI64Extend32S)
3451 v.AddArg(x)
3452 return true
3453 }
3454 }
3455 func rewriteValueWasm_OpSignExt8to16(v *Value) bool {
3456 v_0 := v.Args[0]
3457
3458
3459 for {
3460 x := v_0
3461 if x.Op != OpWasmI64Load8S {
3462 break
3463 }
3464 v.copyOf(x)
3465 return true
3466 }
3467
3468
3469 for {
3470 x := v_0
3471 v.reset(OpWasmI64Extend8S)
3472 v.AddArg(x)
3473 return true
3474 }
3475 }
3476 func rewriteValueWasm_OpSignExt8to32(v *Value) bool {
3477 v_0 := v.Args[0]
3478
3479
3480 for {
3481 x := v_0
3482 if x.Op != OpWasmI64Load8S {
3483 break
3484 }
3485 v.copyOf(x)
3486 return true
3487 }
3488
3489
3490 for {
3491 x := v_0
3492 v.reset(OpWasmI64Extend8S)
3493 v.AddArg(x)
3494 return true
3495 }
3496 }
3497 func rewriteValueWasm_OpSignExt8to64(v *Value) bool {
3498 v_0 := v.Args[0]
3499
3500
3501 for {
3502 x := v_0
3503 if x.Op != OpWasmI64Load8S {
3504 break
3505 }
3506 v.copyOf(x)
3507 return true
3508 }
3509
3510
3511 for {
3512 x := v_0
3513 v.reset(OpWasmI64Extend8S)
3514 v.AddArg(x)
3515 return true
3516 }
3517 }
3518 func rewriteValueWasm_OpSlicemask(v *Value) bool {
3519 v_0 := v.Args[0]
3520 b := v.Block
3521 typ := &b.Func.Config.Types
3522
3523
3524 for {
3525 x := v_0
3526 v.reset(OpWasmI64ShrS)
3527 v0 := b.NewValue0(v.Pos, OpWasmI64Sub, typ.Int64)
3528 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3529 v1.AuxInt = int64ToAuxInt(0)
3530 v0.AddArg2(v1, x)
3531 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3532 v2.AuxInt = int64ToAuxInt(63)
3533 v.AddArg2(v0, v2)
3534 return true
3535 }
3536 }
3537 func rewriteValueWasm_OpStore(v *Value) bool {
3538 v_2 := v.Args[2]
3539 v_1 := v.Args[1]
3540 v_0 := v.Args[0]
3541
3542
3543
3544 for {
3545 t := auxToType(v.Aux)
3546 ptr := v_0
3547 val := v_1
3548 mem := v_2
3549 if !(is64BitFloat(t)) {
3550 break
3551 }
3552 v.reset(OpWasmF64Store)
3553 v.AddArg3(ptr, val, mem)
3554 return true
3555 }
3556
3557
3558
3559 for {
3560 t := auxToType(v.Aux)
3561 ptr := v_0
3562 val := v_1
3563 mem := v_2
3564 if !(is32BitFloat(t)) {
3565 break
3566 }
3567 v.reset(OpWasmF32Store)
3568 v.AddArg3(ptr, val, mem)
3569 return true
3570 }
3571
3572
3573
3574 for {
3575 t := auxToType(v.Aux)
3576 ptr := v_0
3577 val := v_1
3578 mem := v_2
3579 if !(t.Size() == 8) {
3580 break
3581 }
3582 v.reset(OpWasmI64Store)
3583 v.AddArg3(ptr, val, mem)
3584 return true
3585 }
3586
3587
3588
3589 for {
3590 t := auxToType(v.Aux)
3591 ptr := v_0
3592 val := v_1
3593 mem := v_2
3594 if !(t.Size() == 4) {
3595 break
3596 }
3597 v.reset(OpWasmI64Store32)
3598 v.AddArg3(ptr, val, mem)
3599 return true
3600 }
3601
3602
3603
3604 for {
3605 t := auxToType(v.Aux)
3606 ptr := v_0
3607 val := v_1
3608 mem := v_2
3609 if !(t.Size() == 2) {
3610 break
3611 }
3612 v.reset(OpWasmI64Store16)
3613 v.AddArg3(ptr, val, mem)
3614 return true
3615 }
3616
3617
3618
3619 for {
3620 t := auxToType(v.Aux)
3621 ptr := v_0
3622 val := v_1
3623 mem := v_2
3624 if !(t.Size() == 1) {
3625 break
3626 }
3627 v.reset(OpWasmI64Store8)
3628 v.AddArg3(ptr, val, mem)
3629 return true
3630 }
3631 return false
3632 }
3633 func rewriteValueWasm_OpWasmF32DemoteF64(v *Value) bool {
3634 v_0 := v.Args[0]
3635
3636
3637 for {
3638 if v_0.Op != OpWasmF64Sqrt {
3639 break
3640 }
3641 v_0_0 := v_0.Args[0]
3642 if v_0_0.Op != OpWasmF64PromoteF32 {
3643 break
3644 }
3645 x := v_0_0.Args[0]
3646 v.reset(OpWasmF32Sqrt)
3647 v.AddArg(x)
3648 return true
3649 }
3650
3651
3652 for {
3653 if v_0.Op != OpWasmF64Trunc {
3654 break
3655 }
3656 v_0_0 := v_0.Args[0]
3657 if v_0_0.Op != OpWasmF64PromoteF32 {
3658 break
3659 }
3660 x := v_0_0.Args[0]
3661 v.reset(OpWasmF32Trunc)
3662 v.AddArg(x)
3663 return true
3664 }
3665
3666
3667 for {
3668 if v_0.Op != OpWasmF64Ceil {
3669 break
3670 }
3671 v_0_0 := v_0.Args[0]
3672 if v_0_0.Op != OpWasmF64PromoteF32 {
3673 break
3674 }
3675 x := v_0_0.Args[0]
3676 v.reset(OpWasmF32Ceil)
3677 v.AddArg(x)
3678 return true
3679 }
3680
3681
3682 for {
3683 if v_0.Op != OpWasmF64Floor {
3684 break
3685 }
3686 v_0_0 := v_0.Args[0]
3687 if v_0_0.Op != OpWasmF64PromoteF32 {
3688 break
3689 }
3690 x := v_0_0.Args[0]
3691 v.reset(OpWasmF32Floor)
3692 v.AddArg(x)
3693 return true
3694 }
3695
3696
3697 for {
3698 if v_0.Op != OpWasmF64Nearest {
3699 break
3700 }
3701 v_0_0 := v_0.Args[0]
3702 if v_0_0.Op != OpWasmF64PromoteF32 {
3703 break
3704 }
3705 x := v_0_0.Args[0]
3706 v.reset(OpWasmF32Nearest)
3707 v.AddArg(x)
3708 return true
3709 }
3710
3711
3712 for {
3713 if v_0.Op != OpWasmF64Abs {
3714 break
3715 }
3716 v_0_0 := v_0.Args[0]
3717 if v_0_0.Op != OpWasmF64PromoteF32 {
3718 break
3719 }
3720 x := v_0_0.Args[0]
3721 v.reset(OpWasmF32Abs)
3722 v.AddArg(x)
3723 return true
3724 }
3725
3726
3727 for {
3728 if v_0.Op != OpWasmF64Copysign {
3729 break
3730 }
3731 _ = v_0.Args[1]
3732 v_0_0 := v_0.Args[0]
3733 if v_0_0.Op != OpWasmF64PromoteF32 {
3734 break
3735 }
3736 x := v_0_0.Args[0]
3737 v_0_1 := v_0.Args[1]
3738 if v_0_1.Op != OpWasmF64PromoteF32 {
3739 break
3740 }
3741 y := v_0_1.Args[0]
3742 v.reset(OpWasmF32Copysign)
3743 v.AddArg2(x, y)
3744 return true
3745 }
3746 return false
3747 }
3748 func rewriteValueWasm_OpWasmF64Add(v *Value) bool {
3749 v_1 := v.Args[1]
3750 v_0 := v.Args[0]
3751 b := v.Block
3752 typ := &b.Func.Config.Types
3753
3754
3755 for {
3756 if v_0.Op != OpWasmF64Const {
3757 break
3758 }
3759 x := auxIntToFloat64(v_0.AuxInt)
3760 if v_1.Op != OpWasmF64Const {
3761 break
3762 }
3763 y := auxIntToFloat64(v_1.AuxInt)
3764 v.reset(OpWasmF64Const)
3765 v.AuxInt = float64ToAuxInt(x + y)
3766 return true
3767 }
3768
3769
3770
3771 for {
3772 if v_0.Op != OpWasmF64Const {
3773 break
3774 }
3775 x := auxIntToFloat64(v_0.AuxInt)
3776 y := v_1
3777 if !(y.Op != OpWasmF64Const) {
3778 break
3779 }
3780 v.reset(OpWasmF64Add)
3781 v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64)
3782 v0.AuxInt = float64ToAuxInt(x)
3783 v.AddArg2(y, v0)
3784 return true
3785 }
3786 return false
3787 }
3788 func rewriteValueWasm_OpWasmF64Mul(v *Value) bool {
3789 v_1 := v.Args[1]
3790 v_0 := v.Args[0]
3791 b := v.Block
3792 typ := &b.Func.Config.Types
3793
3794
3795
3796 for {
3797 if v_0.Op != OpWasmF64Const {
3798 break
3799 }
3800 x := auxIntToFloat64(v_0.AuxInt)
3801 if v_1.Op != OpWasmF64Const {
3802 break
3803 }
3804 y := auxIntToFloat64(v_1.AuxInt)
3805 if !(!math.IsNaN(x * y)) {
3806 break
3807 }
3808 v.reset(OpWasmF64Const)
3809 v.AuxInt = float64ToAuxInt(x * y)
3810 return true
3811 }
3812
3813
3814
3815 for {
3816 if v_0.Op != OpWasmF64Const {
3817 break
3818 }
3819 x := auxIntToFloat64(v_0.AuxInt)
3820 y := v_1
3821 if !(y.Op != OpWasmF64Const) {
3822 break
3823 }
3824 v.reset(OpWasmF64Mul)
3825 v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64)
3826 v0.AuxInt = float64ToAuxInt(x)
3827 v.AddArg2(y, v0)
3828 return true
3829 }
3830 return false
3831 }
3832 func rewriteValueWasm_OpWasmI64Add(v *Value) bool {
3833 v_1 := v.Args[1]
3834 v_0 := v.Args[0]
3835 b := v.Block
3836 typ := &b.Func.Config.Types
3837
3838
3839 for {
3840 if v_0.Op != OpWasmI64Const {
3841 break
3842 }
3843 x := auxIntToInt64(v_0.AuxInt)
3844 if v_1.Op != OpWasmI64Const {
3845 break
3846 }
3847 y := auxIntToInt64(v_1.AuxInt)
3848 v.reset(OpWasmI64Const)
3849 v.AuxInt = int64ToAuxInt(x + y)
3850 return true
3851 }
3852
3853
3854
3855 for {
3856 if v_0.Op != OpWasmI64Const {
3857 break
3858 }
3859 x := auxIntToInt64(v_0.AuxInt)
3860 y := v_1
3861 if !(y.Op != OpWasmI64Const) {
3862 break
3863 }
3864 v.reset(OpWasmI64Add)
3865 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3866 v0.AuxInt = int64ToAuxInt(x)
3867 v.AddArg2(y, v0)
3868 return true
3869 }
3870
3871
3872
3873 for {
3874 x := v_0
3875 if v_1.Op != OpWasmI64Const {
3876 break
3877 }
3878 t := v_1.Type
3879 y := auxIntToInt64(v_1.AuxInt)
3880 if !(!t.IsPtr()) {
3881 break
3882 }
3883 v.reset(OpWasmI64AddConst)
3884 v.AuxInt = int64ToAuxInt(y)
3885 v.AddArg(x)
3886 return true
3887 }
3888 return false
3889 }
3890 func rewriteValueWasm_OpWasmI64AddConst(v *Value) bool {
3891 v_0 := v.Args[0]
3892
3893
3894 for {
3895 if auxIntToInt64(v.AuxInt) != 0 {
3896 break
3897 }
3898 x := v_0
3899 v.copyOf(x)
3900 return true
3901 }
3902
3903
3904
3905 for {
3906 off := auxIntToInt64(v.AuxInt)
3907 if v_0.Op != OpWasmLoweredAddr {
3908 break
3909 }
3910 off2 := auxIntToInt32(v_0.AuxInt)
3911 sym := auxToSym(v_0.Aux)
3912 base := v_0.Args[0]
3913 if !(isU32Bit(off + int64(off2))) {
3914 break
3915 }
3916 v.reset(OpWasmLoweredAddr)
3917 v.AuxInt = int32ToAuxInt(int32(off) + off2)
3918 v.Aux = symToAux(sym)
3919 v.AddArg(base)
3920 return true
3921 }
3922
3923
3924
3925 for {
3926 off := auxIntToInt64(v.AuxInt)
3927 x := v_0
3928 if x.Op != OpSP || !(isU32Bit(off)) {
3929 break
3930 }
3931 v.reset(OpWasmLoweredAddr)
3932 v.AuxInt = int32ToAuxInt(int32(off))
3933 v.AddArg(x)
3934 return true
3935 }
3936 return false
3937 }
3938 func rewriteValueWasm_OpWasmI64And(v *Value) bool {
3939 v_1 := v.Args[1]
3940 v_0 := v.Args[0]
3941 b := v.Block
3942 typ := &b.Func.Config.Types
3943
3944
3945 for {
3946 if v_0.Op != OpWasmI64Const {
3947 break
3948 }
3949 x := auxIntToInt64(v_0.AuxInt)
3950 if v_1.Op != OpWasmI64Const {
3951 break
3952 }
3953 y := auxIntToInt64(v_1.AuxInt)
3954 v.reset(OpWasmI64Const)
3955 v.AuxInt = int64ToAuxInt(x & y)
3956 return true
3957 }
3958
3959
3960 for {
3961 x := v_0
3962 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != -1 {
3963 break
3964 }
3965 v.copyOf(x)
3966 return true
3967 }
3968
3969
3970 for {
3971 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
3972 break
3973 }
3974 v.reset(OpWasmI64Const)
3975 v.AuxInt = int64ToAuxInt(0)
3976 return true
3977 }
3978
3979
3980 for {
3981 if v_0.Op != OpWasmI64And {
3982 break
3983 }
3984 _ = v_0.Args[1]
3985 x := v_0.Args[0]
3986 v_0_1 := v_0.Args[1]
3987 if v_0_1.Op != OpWasmI64Const {
3988 break
3989 }
3990 c1 := auxIntToInt64(v_0_1.AuxInt)
3991 if v_1.Op != OpWasmI64Const {
3992 break
3993 }
3994 c2 := auxIntToInt64(v_1.AuxInt)
3995 v.reset(OpWasmI64And)
3996 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
3997 v0.AuxInt = int64ToAuxInt(c1 & c2)
3998 v.AddArg2(x, v0)
3999 return true
4000 }
4001
4002
4003
4004 for {
4005 if v_0.Op != OpWasmI64Const {
4006 break
4007 }
4008 x := auxIntToInt64(v_0.AuxInt)
4009 y := v_1
4010 if !(y.Op != OpWasmI64Const) {
4011 break
4012 }
4013 v.reset(OpWasmI64And)
4014 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4015 v0.AuxInt = int64ToAuxInt(x)
4016 v.AddArg2(y, v0)
4017 return true
4018 }
4019 return false
4020 }
4021 func rewriteValueWasm_OpWasmI64Eq(v *Value) bool {
4022 v_1 := v.Args[1]
4023 v_0 := v.Args[0]
4024 b := v.Block
4025 typ := &b.Func.Config.Types
4026
4027
4028
4029 for {
4030 if v_0.Op != OpWasmI64Const {
4031 break
4032 }
4033 x := auxIntToInt64(v_0.AuxInt)
4034 if v_1.Op != OpWasmI64Const {
4035 break
4036 }
4037 y := auxIntToInt64(v_1.AuxInt)
4038 if !(x == y) {
4039 break
4040 }
4041 v.reset(OpWasmI64Const)
4042 v.AuxInt = int64ToAuxInt(1)
4043 return true
4044 }
4045
4046
4047
4048 for {
4049 if v_0.Op != OpWasmI64Const {
4050 break
4051 }
4052 x := auxIntToInt64(v_0.AuxInt)
4053 if v_1.Op != OpWasmI64Const {
4054 break
4055 }
4056 y := auxIntToInt64(v_1.AuxInt)
4057 if !(x != y) {
4058 break
4059 }
4060 v.reset(OpWasmI64Const)
4061 v.AuxInt = int64ToAuxInt(0)
4062 return true
4063 }
4064
4065
4066
4067 for {
4068 if v_0.Op != OpWasmI64Const {
4069 break
4070 }
4071 x := auxIntToInt64(v_0.AuxInt)
4072 y := v_1
4073 if !(y.Op != OpWasmI64Const) {
4074 break
4075 }
4076 v.reset(OpWasmI64Eq)
4077 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4078 v0.AuxInt = int64ToAuxInt(x)
4079 v.AddArg2(y, v0)
4080 return true
4081 }
4082
4083
4084 for {
4085 x := v_0
4086 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4087 break
4088 }
4089 v.reset(OpWasmI64Eqz)
4090 v.AddArg(x)
4091 return true
4092 }
4093 return false
4094 }
4095 func rewriteValueWasm_OpWasmI64Eqz(v *Value) bool {
4096 v_0 := v.Args[0]
4097
4098
4099 for {
4100 if v_0.Op != OpWasmI64Eqz {
4101 break
4102 }
4103 v_0_0 := v_0.Args[0]
4104 if v_0_0.Op != OpWasmI64Eqz {
4105 break
4106 }
4107 x := v_0_0.Args[0]
4108 v.reset(OpWasmI64Eqz)
4109 v.AddArg(x)
4110 return true
4111 }
4112 return false
4113 }
4114 func rewriteValueWasm_OpWasmI64Extend16S(v *Value) bool {
4115 v_0 := v.Args[0]
4116
4117
4118 for {
4119 if v_0.Op != OpWasmI64Extend16S {
4120 break
4121 }
4122 x := v_0.Args[0]
4123 v.reset(OpWasmI64Extend16S)
4124 v.AddArg(x)
4125 return true
4126 }
4127
4128
4129 for {
4130 if v_0.Op != OpWasmI64Extend8S {
4131 break
4132 }
4133 x := v_0.Args[0]
4134 v.reset(OpWasmI64Extend8S)
4135 v.AddArg(x)
4136 return true
4137 }
4138 return false
4139 }
4140 func rewriteValueWasm_OpWasmI64Extend32S(v *Value) bool {
4141 v_0 := v.Args[0]
4142
4143
4144 for {
4145 if v_0.Op != OpWasmI64Extend32S {
4146 break
4147 }
4148 x := v_0.Args[0]
4149 v.reset(OpWasmI64Extend32S)
4150 v.AddArg(x)
4151 return true
4152 }
4153
4154
4155 for {
4156 if v_0.Op != OpWasmI64Extend16S {
4157 break
4158 }
4159 x := v_0.Args[0]
4160 v.reset(OpWasmI64Extend16S)
4161 v.AddArg(x)
4162 return true
4163 }
4164
4165
4166 for {
4167 if v_0.Op != OpWasmI64Extend8S {
4168 break
4169 }
4170 x := v_0.Args[0]
4171 v.reset(OpWasmI64Extend8S)
4172 v.AddArg(x)
4173 return true
4174 }
4175 return false
4176 }
4177 func rewriteValueWasm_OpWasmI64Extend8S(v *Value) bool {
4178 v_0 := v.Args[0]
4179
4180
4181 for {
4182 if v_0.Op != OpWasmI64Extend8S {
4183 break
4184 }
4185 x := v_0.Args[0]
4186 v.reset(OpWasmI64Extend8S)
4187 v.AddArg(x)
4188 return true
4189 }
4190 return false
4191 }
4192 func rewriteValueWasm_OpWasmI64LeU(v *Value) bool {
4193 v_1 := v.Args[1]
4194 v_0 := v.Args[0]
4195 b := v.Block
4196 typ := &b.Func.Config.Types
4197
4198
4199 for {
4200 x := v_0
4201 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4202 break
4203 }
4204 v.reset(OpWasmI64Eqz)
4205 v.AddArg(x)
4206 return true
4207 }
4208
4209
4210 for {
4211 if v_0.Op != OpWasmI64Const || auxIntToInt64(v_0.AuxInt) != 1 {
4212 break
4213 }
4214 x := v_1
4215 v.reset(OpWasmI64Eqz)
4216 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
4217 v0.AddArg(x)
4218 v.AddArg(v0)
4219 return true
4220 }
4221 return false
4222 }
4223 func rewriteValueWasm_OpWasmI64Load(v *Value) bool {
4224 v_1 := v.Args[1]
4225 v_0 := v.Args[0]
4226 b := v.Block
4227 config := b.Func.Config
4228
4229
4230
4231 for {
4232 off := auxIntToInt64(v.AuxInt)
4233 if v_0.Op != OpWasmI64AddConst {
4234 break
4235 }
4236 off2 := auxIntToInt64(v_0.AuxInt)
4237 ptr := v_0.Args[0]
4238 mem := v_1
4239 if !(isU32Bit(off + off2)) {
4240 break
4241 }
4242 v.reset(OpWasmI64Load)
4243 v.AuxInt = int64ToAuxInt(off + off2)
4244 v.AddArg2(ptr, mem)
4245 return true
4246 }
4247
4248
4249
4250 for {
4251 off := auxIntToInt64(v.AuxInt)
4252 if v_0.Op != OpWasmLoweredAddr {
4253 break
4254 }
4255 off2 := auxIntToInt32(v_0.AuxInt)
4256 sym := auxToSym(v_0.Aux)
4257 v_0_0 := v_0.Args[0]
4258 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4259 break
4260 }
4261 v.reset(OpWasmI64Const)
4262 v.AuxInt = int64ToAuxInt(int64(read64(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
4263 return true
4264 }
4265 return false
4266 }
4267 func rewriteValueWasm_OpWasmI64Load16S(v *Value) bool {
4268 v_1 := v.Args[1]
4269 v_0 := v.Args[0]
4270 b := v.Block
4271 config := b.Func.Config
4272
4273
4274
4275 for {
4276 off := auxIntToInt64(v.AuxInt)
4277 if v_0.Op != OpWasmI64AddConst {
4278 break
4279 }
4280 off2 := auxIntToInt64(v_0.AuxInt)
4281 ptr := v_0.Args[0]
4282 mem := v_1
4283 if !(isU32Bit(off + off2)) {
4284 break
4285 }
4286 v.reset(OpWasmI64Load16S)
4287 v.AuxInt = int64ToAuxInt(off + off2)
4288 v.AddArg2(ptr, mem)
4289 return true
4290 }
4291
4292
4293
4294 for {
4295 off := auxIntToInt64(v.AuxInt)
4296 if v_0.Op != OpWasmLoweredAddr {
4297 break
4298 }
4299 off2 := auxIntToInt32(v_0.AuxInt)
4300 sym := auxToSym(v_0.Aux)
4301 v_0_0 := v_0.Args[0]
4302 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4303 break
4304 }
4305 v.reset(OpWasmI64Const)
4306 v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))))
4307 return true
4308 }
4309 return false
4310 }
4311 func rewriteValueWasm_OpWasmI64Load16U(v *Value) bool {
4312 v_1 := v.Args[1]
4313 v_0 := v.Args[0]
4314 b := v.Block
4315 config := b.Func.Config
4316
4317
4318
4319 for {
4320 off := auxIntToInt64(v.AuxInt)
4321 if v_0.Op != OpWasmI64AddConst {
4322 break
4323 }
4324 off2 := auxIntToInt64(v_0.AuxInt)
4325 ptr := v_0.Args[0]
4326 mem := v_1
4327 if !(isU32Bit(off + off2)) {
4328 break
4329 }
4330 v.reset(OpWasmI64Load16U)
4331 v.AuxInt = int64ToAuxInt(off + off2)
4332 v.AddArg2(ptr, mem)
4333 return true
4334 }
4335
4336
4337
4338 for {
4339 off := auxIntToInt64(v.AuxInt)
4340 if v_0.Op != OpWasmLoweredAddr {
4341 break
4342 }
4343 off2 := auxIntToInt32(v_0.AuxInt)
4344 sym := auxToSym(v_0.Aux)
4345 v_0_0 := v_0.Args[0]
4346 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4347 break
4348 }
4349 v.reset(OpWasmI64Const)
4350 v.AuxInt = int64ToAuxInt(int64(read16(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
4351 return true
4352 }
4353 return false
4354 }
4355 func rewriteValueWasm_OpWasmI64Load32S(v *Value) bool {
4356 v_1 := v.Args[1]
4357 v_0 := v.Args[0]
4358 b := v.Block
4359 config := b.Func.Config
4360
4361
4362
4363 for {
4364 off := auxIntToInt64(v.AuxInt)
4365 if v_0.Op != OpWasmI64AddConst {
4366 break
4367 }
4368 off2 := auxIntToInt64(v_0.AuxInt)
4369 ptr := v_0.Args[0]
4370 mem := v_1
4371 if !(isU32Bit(off + off2)) {
4372 break
4373 }
4374 v.reset(OpWasmI64Load32S)
4375 v.AuxInt = int64ToAuxInt(off + off2)
4376 v.AddArg2(ptr, mem)
4377 return true
4378 }
4379
4380
4381
4382 for {
4383 off := auxIntToInt64(v.AuxInt)
4384 if v_0.Op != OpWasmLoweredAddr {
4385 break
4386 }
4387 off2 := auxIntToInt32(v_0.AuxInt)
4388 sym := auxToSym(v_0.Aux)
4389 v_0_0 := v_0.Args[0]
4390 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4391 break
4392 }
4393 v.reset(OpWasmI64Const)
4394 v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder))))
4395 return true
4396 }
4397 return false
4398 }
4399 func rewriteValueWasm_OpWasmI64Load32U(v *Value) bool {
4400 v_1 := v.Args[1]
4401 v_0 := v.Args[0]
4402 b := v.Block
4403 config := b.Func.Config
4404
4405
4406
4407 for {
4408 off := auxIntToInt64(v.AuxInt)
4409 if v_0.Op != OpWasmI64AddConst {
4410 break
4411 }
4412 off2 := auxIntToInt64(v_0.AuxInt)
4413 ptr := v_0.Args[0]
4414 mem := v_1
4415 if !(isU32Bit(off + off2)) {
4416 break
4417 }
4418 v.reset(OpWasmI64Load32U)
4419 v.AuxInt = int64ToAuxInt(off + off2)
4420 v.AddArg2(ptr, mem)
4421 return true
4422 }
4423
4424
4425
4426 for {
4427 off := auxIntToInt64(v.AuxInt)
4428 if v_0.Op != OpWasmLoweredAddr {
4429 break
4430 }
4431 off2 := auxIntToInt32(v_0.AuxInt)
4432 sym := auxToSym(v_0.Aux)
4433 v_0_0 := v_0.Args[0]
4434 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4435 break
4436 }
4437 v.reset(OpWasmI64Const)
4438 v.AuxInt = int64ToAuxInt(int64(read32(sym, off+int64(off2), config.ctxt.Arch.ByteOrder)))
4439 return true
4440 }
4441 return false
4442 }
4443 func rewriteValueWasm_OpWasmI64Load8S(v *Value) bool {
4444 v_1 := v.Args[1]
4445 v_0 := v.Args[0]
4446
4447
4448
4449 for {
4450 off := auxIntToInt64(v.AuxInt)
4451 if v_0.Op != OpWasmI64AddConst {
4452 break
4453 }
4454 off2 := auxIntToInt64(v_0.AuxInt)
4455 ptr := v_0.Args[0]
4456 mem := v_1
4457 if !(isU32Bit(off + off2)) {
4458 break
4459 }
4460 v.reset(OpWasmI64Load8S)
4461 v.AuxInt = int64ToAuxInt(off + off2)
4462 v.AddArg2(ptr, mem)
4463 return true
4464 }
4465
4466
4467
4468 for {
4469 off := auxIntToInt64(v.AuxInt)
4470 if v_0.Op != OpWasmLoweredAddr {
4471 break
4472 }
4473 off2 := auxIntToInt32(v_0.AuxInt)
4474 sym := auxToSym(v_0.Aux)
4475 v_0_0 := v_0.Args[0]
4476 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4477 break
4478 }
4479 v.reset(OpWasmI64Const)
4480 v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, off+int64(off2)))))
4481 return true
4482 }
4483 return false
4484 }
4485 func rewriteValueWasm_OpWasmI64Load8U(v *Value) bool {
4486 v_1 := v.Args[1]
4487 v_0 := v.Args[0]
4488
4489
4490
4491 for {
4492 off := auxIntToInt64(v.AuxInt)
4493 if v_0.Op != OpWasmI64AddConst {
4494 break
4495 }
4496 off2 := auxIntToInt64(v_0.AuxInt)
4497 ptr := v_0.Args[0]
4498 mem := v_1
4499 if !(isU32Bit(off + off2)) {
4500 break
4501 }
4502 v.reset(OpWasmI64Load8U)
4503 v.AuxInt = int64ToAuxInt(off + off2)
4504 v.AddArg2(ptr, mem)
4505 return true
4506 }
4507
4508
4509
4510 for {
4511 off := auxIntToInt64(v.AuxInt)
4512 if v_0.Op != OpWasmLoweredAddr {
4513 break
4514 }
4515 off2 := auxIntToInt32(v_0.AuxInt)
4516 sym := auxToSym(v_0.Aux)
4517 v_0_0 := v_0.Args[0]
4518 if v_0_0.Op != OpSB || !(symIsRO(sym) && isU32Bit(off+int64(off2))) {
4519 break
4520 }
4521 v.reset(OpWasmI64Const)
4522 v.AuxInt = int64ToAuxInt(int64(read8(sym, off+int64(off2))))
4523 return true
4524 }
4525 return false
4526 }
4527 func rewriteValueWasm_OpWasmI64LtU(v *Value) bool {
4528 v_1 := v.Args[1]
4529 v_0 := v.Args[0]
4530 b := v.Block
4531 typ := &b.Func.Config.Types
4532
4533
4534 for {
4535 if v_0.Op != OpWasmI64Const || auxIntToInt64(v_0.AuxInt) != 0 {
4536 break
4537 }
4538 x := v_1
4539 v.reset(OpWasmI64Eqz)
4540 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
4541 v0.AddArg(x)
4542 v.AddArg(v0)
4543 return true
4544 }
4545
4546
4547 for {
4548 x := v_0
4549 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 1 {
4550 break
4551 }
4552 v.reset(OpWasmI64Eqz)
4553 v.AddArg(x)
4554 return true
4555 }
4556 return false
4557 }
4558 func rewriteValueWasm_OpWasmI64Mul(v *Value) bool {
4559 v_1 := v.Args[1]
4560 v_0 := v.Args[0]
4561 b := v.Block
4562 typ := &b.Func.Config.Types
4563
4564
4565 for {
4566 if v_0.Op != OpWasmI64Const {
4567 break
4568 }
4569 x := auxIntToInt64(v_0.AuxInt)
4570 if v_1.Op != OpWasmI64Const {
4571 break
4572 }
4573 y := auxIntToInt64(v_1.AuxInt)
4574 v.reset(OpWasmI64Const)
4575 v.AuxInt = int64ToAuxInt(x * y)
4576 return true
4577 }
4578
4579
4580 for {
4581 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4582 break
4583 }
4584 v.reset(OpWasmI64Const)
4585 v.AuxInt = int64ToAuxInt(0)
4586 return true
4587 }
4588
4589
4590 for {
4591 x := v_0
4592 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 1 {
4593 break
4594 }
4595 v.copyOf(x)
4596 return true
4597 }
4598
4599
4600
4601 for {
4602 if v_0.Op != OpWasmI64Const {
4603 break
4604 }
4605 x := auxIntToInt64(v_0.AuxInt)
4606 y := v_1
4607 if !(y.Op != OpWasmI64Const) {
4608 break
4609 }
4610 v.reset(OpWasmI64Mul)
4611 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4612 v0.AuxInt = int64ToAuxInt(x)
4613 v.AddArg2(y, v0)
4614 return true
4615 }
4616 return false
4617 }
4618 func rewriteValueWasm_OpWasmI64Ne(v *Value) bool {
4619 v_1 := v.Args[1]
4620 v_0 := v.Args[0]
4621 b := v.Block
4622 typ := &b.Func.Config.Types
4623
4624
4625
4626 for {
4627 if v_0.Op != OpWasmI64Const {
4628 break
4629 }
4630 x := auxIntToInt64(v_0.AuxInt)
4631 if v_1.Op != OpWasmI64Const {
4632 break
4633 }
4634 y := auxIntToInt64(v_1.AuxInt)
4635 if !(x == y) {
4636 break
4637 }
4638 v.reset(OpWasmI64Const)
4639 v.AuxInt = int64ToAuxInt(0)
4640 return true
4641 }
4642
4643
4644
4645 for {
4646 if v_0.Op != OpWasmI64Const {
4647 break
4648 }
4649 x := auxIntToInt64(v_0.AuxInt)
4650 if v_1.Op != OpWasmI64Const {
4651 break
4652 }
4653 y := auxIntToInt64(v_1.AuxInt)
4654 if !(x != y) {
4655 break
4656 }
4657 v.reset(OpWasmI64Const)
4658 v.AuxInt = int64ToAuxInt(1)
4659 return true
4660 }
4661
4662
4663
4664 for {
4665 if v_0.Op != OpWasmI64Const {
4666 break
4667 }
4668 x := auxIntToInt64(v_0.AuxInt)
4669 y := v_1
4670 if !(y.Op != OpWasmI64Const) {
4671 break
4672 }
4673 v.reset(OpWasmI64Ne)
4674 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4675 v0.AuxInt = int64ToAuxInt(x)
4676 v.AddArg2(y, v0)
4677 return true
4678 }
4679
4680
4681 for {
4682 x := v_0
4683 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4684 break
4685 }
4686 v.reset(OpWasmI64Eqz)
4687 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool)
4688 v0.AddArg(x)
4689 v.AddArg(v0)
4690 return true
4691 }
4692 return false
4693 }
4694 func rewriteValueWasm_OpWasmI64Or(v *Value) bool {
4695 v_1 := v.Args[1]
4696 v_0 := v.Args[0]
4697 b := v.Block
4698 typ := &b.Func.Config.Types
4699
4700
4701 for {
4702 if v_0.Op != OpWasmI64Const {
4703 break
4704 }
4705 x := auxIntToInt64(v_0.AuxInt)
4706 if v_1.Op != OpWasmI64Const {
4707 break
4708 }
4709 y := auxIntToInt64(v_1.AuxInt)
4710 v.reset(OpWasmI64Const)
4711 v.AuxInt = int64ToAuxInt(x | y)
4712 return true
4713 }
4714
4715
4716 for {
4717 x := v_0
4718 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4719 break
4720 }
4721 v.copyOf(x)
4722 return true
4723 }
4724
4725
4726 for {
4727 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != -1 {
4728 break
4729 }
4730 v.reset(OpWasmI64Const)
4731 v.AuxInt = int64ToAuxInt(-1)
4732 return true
4733 }
4734
4735
4736
4737 for {
4738 if v_0.Op != OpWasmI64Const {
4739 break
4740 }
4741 x := auxIntToInt64(v_0.AuxInt)
4742 y := v_1
4743 if !(y.Op != OpWasmI64Const) {
4744 break
4745 }
4746 v.reset(OpWasmI64Or)
4747 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4748 v0.AuxInt = int64ToAuxInt(x)
4749 v.AddArg2(y, v0)
4750 return true
4751 }
4752 return false
4753 }
4754 func rewriteValueWasm_OpWasmI64Shl(v *Value) bool {
4755 v_1 := v.Args[1]
4756 v_0 := v.Args[0]
4757
4758
4759 for {
4760 if v_0.Op != OpWasmI64Const {
4761 break
4762 }
4763 x := auxIntToInt64(v_0.AuxInt)
4764 if v_1.Op != OpWasmI64Const {
4765 break
4766 }
4767 y := auxIntToInt64(v_1.AuxInt)
4768 v.reset(OpWasmI64Const)
4769 v.AuxInt = int64ToAuxInt(x << uint64(y))
4770 return true
4771 }
4772 return false
4773 }
4774 func rewriteValueWasm_OpWasmI64ShrS(v *Value) bool {
4775 v_1 := v.Args[1]
4776 v_0 := v.Args[0]
4777
4778
4779 for {
4780 if v_0.Op != OpWasmI64Const {
4781 break
4782 }
4783 x := auxIntToInt64(v_0.AuxInt)
4784 if v_1.Op != OpWasmI64Const {
4785 break
4786 }
4787 y := auxIntToInt64(v_1.AuxInt)
4788 v.reset(OpWasmI64Const)
4789 v.AuxInt = int64ToAuxInt(x >> uint64(y))
4790 return true
4791 }
4792 return false
4793 }
4794 func rewriteValueWasm_OpWasmI64ShrU(v *Value) bool {
4795 v_1 := v.Args[1]
4796 v_0 := v.Args[0]
4797
4798
4799 for {
4800 if v_0.Op != OpWasmI64Const {
4801 break
4802 }
4803 x := auxIntToInt64(v_0.AuxInt)
4804 if v_1.Op != OpWasmI64Const {
4805 break
4806 }
4807 y := auxIntToInt64(v_1.AuxInt)
4808 v.reset(OpWasmI64Const)
4809 v.AuxInt = int64ToAuxInt(int64(uint64(x) >> uint64(y)))
4810 return true
4811 }
4812 return false
4813 }
4814 func rewriteValueWasm_OpWasmI64Store(v *Value) bool {
4815 v_2 := v.Args[2]
4816 v_1 := v.Args[1]
4817 v_0 := v.Args[0]
4818
4819
4820
4821 for {
4822 off := auxIntToInt64(v.AuxInt)
4823 if v_0.Op != OpWasmI64AddConst {
4824 break
4825 }
4826 off2 := auxIntToInt64(v_0.AuxInt)
4827 ptr := v_0.Args[0]
4828 val := v_1
4829 mem := v_2
4830 if !(isU32Bit(off + off2)) {
4831 break
4832 }
4833 v.reset(OpWasmI64Store)
4834 v.AuxInt = int64ToAuxInt(off + off2)
4835 v.AddArg3(ptr, val, mem)
4836 return true
4837 }
4838 return false
4839 }
4840 func rewriteValueWasm_OpWasmI64Store16(v *Value) bool {
4841 v_2 := v.Args[2]
4842 v_1 := v.Args[1]
4843 v_0 := v.Args[0]
4844
4845
4846
4847 for {
4848 off := auxIntToInt64(v.AuxInt)
4849 if v_0.Op != OpWasmI64AddConst {
4850 break
4851 }
4852 off2 := auxIntToInt64(v_0.AuxInt)
4853 ptr := v_0.Args[0]
4854 val := v_1
4855 mem := v_2
4856 if !(isU32Bit(off + off2)) {
4857 break
4858 }
4859 v.reset(OpWasmI64Store16)
4860 v.AuxInt = int64ToAuxInt(off + off2)
4861 v.AddArg3(ptr, val, mem)
4862 return true
4863 }
4864 return false
4865 }
4866 func rewriteValueWasm_OpWasmI64Store32(v *Value) bool {
4867 v_2 := v.Args[2]
4868 v_1 := v.Args[1]
4869 v_0 := v.Args[0]
4870
4871
4872
4873 for {
4874 off := auxIntToInt64(v.AuxInt)
4875 if v_0.Op != OpWasmI64AddConst {
4876 break
4877 }
4878 off2 := auxIntToInt64(v_0.AuxInt)
4879 ptr := v_0.Args[0]
4880 val := v_1
4881 mem := v_2
4882 if !(isU32Bit(off + off2)) {
4883 break
4884 }
4885 v.reset(OpWasmI64Store32)
4886 v.AuxInt = int64ToAuxInt(off + off2)
4887 v.AddArg3(ptr, val, mem)
4888 return true
4889 }
4890 return false
4891 }
4892 func rewriteValueWasm_OpWasmI64Store8(v *Value) bool {
4893 v_2 := v.Args[2]
4894 v_1 := v.Args[1]
4895 v_0 := v.Args[0]
4896
4897
4898
4899 for {
4900 off := auxIntToInt64(v.AuxInt)
4901 if v_0.Op != OpWasmI64AddConst {
4902 break
4903 }
4904 off2 := auxIntToInt64(v_0.AuxInt)
4905 ptr := v_0.Args[0]
4906 val := v_1
4907 mem := v_2
4908 if !(isU32Bit(off + off2)) {
4909 break
4910 }
4911 v.reset(OpWasmI64Store8)
4912 v.AuxInt = int64ToAuxInt(off + off2)
4913 v.AddArg3(ptr, val, mem)
4914 return true
4915 }
4916 return false
4917 }
4918 func rewriteValueWasm_OpWasmI64Sub(v *Value) bool {
4919 v_1 := v.Args[1]
4920 v_0 := v.Args[0]
4921
4922
4923 for {
4924 if v_0.Op != OpWasmI64Const {
4925 break
4926 }
4927 x := auxIntToInt64(v_0.AuxInt)
4928 if v_1.Op != OpWasmI64Const {
4929 break
4930 }
4931 y := auxIntToInt64(v_1.AuxInt)
4932 v.reset(OpWasmI64Const)
4933 v.AuxInt = int64ToAuxInt(x - y)
4934 return true
4935 }
4936 return false
4937 }
4938 func rewriteValueWasm_OpWasmI64Xor(v *Value) bool {
4939 v_1 := v.Args[1]
4940 v_0 := v.Args[0]
4941 b := v.Block
4942 typ := &b.Func.Config.Types
4943
4944
4945 for {
4946 if v_0.Op != OpWasmI64Const {
4947 break
4948 }
4949 x := auxIntToInt64(v_0.AuxInt)
4950 if v_1.Op != OpWasmI64Const {
4951 break
4952 }
4953 y := auxIntToInt64(v_1.AuxInt)
4954 v.reset(OpWasmI64Const)
4955 v.AuxInt = int64ToAuxInt(x ^ y)
4956 return true
4957 }
4958
4959
4960 for {
4961 x := v_0
4962 if v_1.Op != OpWasmI64Const || auxIntToInt64(v_1.AuxInt) != 0 {
4963 break
4964 }
4965 v.copyOf(x)
4966 return true
4967 }
4968
4969
4970
4971 for {
4972 if v_0.Op != OpWasmI64Const {
4973 break
4974 }
4975 x := auxIntToInt64(v_0.AuxInt)
4976 y := v_1
4977 if !(y.Op != OpWasmI64Const) {
4978 break
4979 }
4980 v.reset(OpWasmI64Xor)
4981 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
4982 v0.AuxInt = int64ToAuxInt(x)
4983 v.AddArg2(y, v0)
4984 return true
4985 }
4986 return false
4987 }
4988 func rewriteValueWasm_OpZero(v *Value) bool {
4989 v_1 := v.Args[1]
4990 v_0 := v.Args[0]
4991 b := v.Block
4992 typ := &b.Func.Config.Types
4993
4994
4995 for {
4996 if auxIntToInt64(v.AuxInt) != 0 {
4997 break
4998 }
4999 mem := v_1
5000 v.copyOf(mem)
5001 return true
5002 }
5003
5004
5005 for {
5006 if auxIntToInt64(v.AuxInt) != 1 {
5007 break
5008 }
5009 destptr := v_0
5010 mem := v_1
5011 v.reset(OpWasmI64Store8)
5012 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5013 v0.AuxInt = int64ToAuxInt(0)
5014 v.AddArg3(destptr, v0, mem)
5015 return true
5016 }
5017
5018
5019 for {
5020 if auxIntToInt64(v.AuxInt) != 2 {
5021 break
5022 }
5023 destptr := v_0
5024 mem := v_1
5025 v.reset(OpWasmI64Store16)
5026 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5027 v0.AuxInt = int64ToAuxInt(0)
5028 v.AddArg3(destptr, v0, mem)
5029 return true
5030 }
5031
5032
5033 for {
5034 if auxIntToInt64(v.AuxInt) != 4 {
5035 break
5036 }
5037 destptr := v_0
5038 mem := v_1
5039 v.reset(OpWasmI64Store32)
5040 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5041 v0.AuxInt = int64ToAuxInt(0)
5042 v.AddArg3(destptr, v0, mem)
5043 return true
5044 }
5045
5046
5047 for {
5048 if auxIntToInt64(v.AuxInt) != 8 {
5049 break
5050 }
5051 destptr := v_0
5052 mem := v_1
5053 v.reset(OpWasmI64Store)
5054 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5055 v0.AuxInt = int64ToAuxInt(0)
5056 v.AddArg3(destptr, v0, mem)
5057 return true
5058 }
5059
5060
5061 for {
5062 if auxIntToInt64(v.AuxInt) != 3 {
5063 break
5064 }
5065 destptr := v_0
5066 mem := v_1
5067 v.reset(OpWasmI64Store8)
5068 v.AuxInt = int64ToAuxInt(2)
5069 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5070 v0.AuxInt = int64ToAuxInt(0)
5071 v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem)
5072 v1.AddArg3(destptr, v0, mem)
5073 v.AddArg3(destptr, v0, v1)
5074 return true
5075 }
5076
5077
5078 for {
5079 if auxIntToInt64(v.AuxInt) != 5 {
5080 break
5081 }
5082 destptr := v_0
5083 mem := v_1
5084 v.reset(OpWasmI64Store8)
5085 v.AuxInt = int64ToAuxInt(4)
5086 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5087 v0.AuxInt = int64ToAuxInt(0)
5088 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
5089 v1.AddArg3(destptr, v0, mem)
5090 v.AddArg3(destptr, v0, v1)
5091 return true
5092 }
5093
5094
5095 for {
5096 if auxIntToInt64(v.AuxInt) != 6 {
5097 break
5098 }
5099 destptr := v_0
5100 mem := v_1
5101 v.reset(OpWasmI64Store16)
5102 v.AuxInt = int64ToAuxInt(4)
5103 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5104 v0.AuxInt = int64ToAuxInt(0)
5105 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
5106 v1.AddArg3(destptr, v0, mem)
5107 v.AddArg3(destptr, v0, v1)
5108 return true
5109 }
5110
5111
5112 for {
5113 if auxIntToInt64(v.AuxInt) != 7 {
5114 break
5115 }
5116 destptr := v_0
5117 mem := v_1
5118 v.reset(OpWasmI64Store32)
5119 v.AuxInt = int64ToAuxInt(3)
5120 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5121 v0.AuxInt = int64ToAuxInt(0)
5122 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem)
5123 v1.AddArg3(destptr, v0, mem)
5124 v.AddArg3(destptr, v0, v1)
5125 return true
5126 }
5127
5128
5129
5130 for {
5131 s := auxIntToInt64(v.AuxInt)
5132 destptr := v_0
5133 mem := v_1
5134 if !(s%8 != 0 && s > 8 && s < 32) {
5135 break
5136 }
5137 v.reset(OpZero)
5138 v.AuxInt = int64ToAuxInt(s - s%8)
5139 v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type)
5140 v0.AuxInt = int64ToAuxInt(s % 8)
5141 v0.AddArg(destptr)
5142 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5143 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5144 v2.AuxInt = int64ToAuxInt(0)
5145 v1.AddArg3(destptr, v2, mem)
5146 v.AddArg2(v0, v1)
5147 return true
5148 }
5149
5150
5151 for {
5152 if auxIntToInt64(v.AuxInt) != 16 {
5153 break
5154 }
5155 destptr := v_0
5156 mem := v_1
5157 v.reset(OpWasmI64Store)
5158 v.AuxInt = int64ToAuxInt(8)
5159 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5160 v0.AuxInt = int64ToAuxInt(0)
5161 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5162 v1.AddArg3(destptr, v0, mem)
5163 v.AddArg3(destptr, v0, v1)
5164 return true
5165 }
5166
5167
5168 for {
5169 if auxIntToInt64(v.AuxInt) != 24 {
5170 break
5171 }
5172 destptr := v_0
5173 mem := v_1
5174 v.reset(OpWasmI64Store)
5175 v.AuxInt = int64ToAuxInt(16)
5176 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5177 v0.AuxInt = int64ToAuxInt(0)
5178 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5179 v1.AuxInt = int64ToAuxInt(8)
5180 v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5181 v2.AddArg3(destptr, v0, mem)
5182 v1.AddArg3(destptr, v0, v2)
5183 v.AddArg3(destptr, v0, v1)
5184 return true
5185 }
5186
5187
5188 for {
5189 if auxIntToInt64(v.AuxInt) != 32 {
5190 break
5191 }
5192 destptr := v_0
5193 mem := v_1
5194 v.reset(OpWasmI64Store)
5195 v.AuxInt = int64ToAuxInt(24)
5196 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5197 v0.AuxInt = int64ToAuxInt(0)
5198 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5199 v1.AuxInt = int64ToAuxInt(16)
5200 v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5201 v2.AuxInt = int64ToAuxInt(8)
5202 v3 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem)
5203 v3.AddArg3(destptr, v0, mem)
5204 v2.AddArg3(destptr, v0, v3)
5205 v1.AddArg3(destptr, v0, v2)
5206 v.AddArg3(destptr, v0, v1)
5207 return true
5208 }
5209
5210
5211 for {
5212 s := auxIntToInt64(v.AuxInt)
5213 destptr := v_0
5214 mem := v_1
5215 v.reset(OpWasmLoweredZero)
5216 v.AuxInt = int64ToAuxInt(s)
5217 v.AddArg2(destptr, mem)
5218 return true
5219 }
5220 }
5221 func rewriteValueWasm_OpZeroExt16to32(v *Value) bool {
5222 v_0 := v.Args[0]
5223 b := v.Block
5224 typ := &b.Func.Config.Types
5225
5226
5227 for {
5228 x := v_0
5229 if x.Op != OpWasmI64Load16U {
5230 break
5231 }
5232 v.copyOf(x)
5233 return true
5234 }
5235
5236
5237 for {
5238 x := v_0
5239 v.reset(OpWasmI64And)
5240 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5241 v0.AuxInt = int64ToAuxInt(0xffff)
5242 v.AddArg2(x, v0)
5243 return true
5244 }
5245 }
5246 func rewriteValueWasm_OpZeroExt16to64(v *Value) bool {
5247 v_0 := v.Args[0]
5248 b := v.Block
5249 typ := &b.Func.Config.Types
5250
5251
5252 for {
5253 x := v_0
5254 if x.Op != OpWasmI64Load16U {
5255 break
5256 }
5257 v.copyOf(x)
5258 return true
5259 }
5260
5261
5262 for {
5263 x := v_0
5264 v.reset(OpWasmI64And)
5265 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5266 v0.AuxInt = int64ToAuxInt(0xffff)
5267 v.AddArg2(x, v0)
5268 return true
5269 }
5270 }
5271 func rewriteValueWasm_OpZeroExt32to64(v *Value) bool {
5272 v_0 := v.Args[0]
5273 b := v.Block
5274 typ := &b.Func.Config.Types
5275
5276
5277 for {
5278 x := v_0
5279 if x.Op != OpWasmI64Load32U {
5280 break
5281 }
5282 v.copyOf(x)
5283 return true
5284 }
5285
5286
5287 for {
5288 x := v_0
5289 v.reset(OpWasmI64And)
5290 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5291 v0.AuxInt = int64ToAuxInt(0xffffffff)
5292 v.AddArg2(x, v0)
5293 return true
5294 }
5295 }
5296 func rewriteValueWasm_OpZeroExt8to16(v *Value) bool {
5297 v_0 := v.Args[0]
5298 b := v.Block
5299 typ := &b.Func.Config.Types
5300
5301
5302 for {
5303 x := v_0
5304 if x.Op != OpWasmI64Load8U {
5305 break
5306 }
5307 v.copyOf(x)
5308 return true
5309 }
5310
5311
5312 for {
5313 x := v_0
5314 v.reset(OpWasmI64And)
5315 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5316 v0.AuxInt = int64ToAuxInt(0xff)
5317 v.AddArg2(x, v0)
5318 return true
5319 }
5320 }
5321 func rewriteValueWasm_OpZeroExt8to32(v *Value) bool {
5322 v_0 := v.Args[0]
5323 b := v.Block
5324 typ := &b.Func.Config.Types
5325
5326
5327 for {
5328 x := v_0
5329 if x.Op != OpWasmI64Load8U {
5330 break
5331 }
5332 v.copyOf(x)
5333 return true
5334 }
5335
5336
5337 for {
5338 x := v_0
5339 v.reset(OpWasmI64And)
5340 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5341 v0.AuxInt = int64ToAuxInt(0xff)
5342 v.AddArg2(x, v0)
5343 return true
5344 }
5345 }
5346 func rewriteValueWasm_OpZeroExt8to64(v *Value) bool {
5347 v_0 := v.Args[0]
5348 b := v.Block
5349 typ := &b.Func.Config.Types
5350
5351
5352 for {
5353 x := v_0
5354 if x.Op != OpWasmI64Load8U {
5355 break
5356 }
5357 v.copyOf(x)
5358 return true
5359 }
5360
5361
5362 for {
5363 x := v_0
5364 v.reset(OpWasmI64And)
5365 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64)
5366 v0.AuxInt = int64ToAuxInt(0xff)
5367 v.AddArg2(x, v0)
5368 return true
5369 }
5370 }
5371 func rewriteBlockWasm(b *Block) bool {
5372 return false
5373 }
5374
View as plain text