1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
.text
.file "/s/llvm-upstream/llvm/test/CodeGen/WebAssembly/i128.ll"
.globl add128
.type add128,@function
add128:
.param i32, i64, i64, i64, i64
.local i64
i64.add $push10=, $1, $3
tee_local $push9=, $5=, $pop10
i64.store 0($0), $pop9
i32.const $push7=, 8
i32.add $push8=, $0, $pop7
i64.add $push5=, $2, $4
i64.const $push3=, 1
i64.lt_u $push1=, $5, $1
i64.extend_u/i32 $push2=, $pop1
i64.lt_u $push0=, $5, $3
i64.select $push4=, $pop3, $pop2, $pop0
i64.add $push6=, $pop5, $pop4
i64.store 0($pop8), $pop6
return
.endfunc
.Lfunc_end0:
.size add128, .Lfunc_end0-add128
.globl sub128
.type sub128,@function
sub128:
.param i32, i64, i64, i64, i64
i64.sub $push0=, $1, $3
i64.store 0($0), $pop0
i32.const $push5=, 8
i32.add $push6=, $0, $pop5
i64.sub $push1=, $2, $4
i64.lt_u $push2=, $1, $3
i64.extend_u/i32 $push3=, $pop2
i64.sub $push4=, $pop1, $pop3
i64.store 0($pop6), $pop4
return
.endfunc
.Lfunc_end1:
.size sub128, .Lfunc_end1-sub128
.globl mul128
.type mul128,@function
mul128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push8=, 0
i32.const $push5=, 0
i32.load $push6=, __stack_pointer($pop5)
i32.const $push7=, 16
i32.sub $push14=, $pop6, $pop7
tee_local $push13=, $5=, $pop14
i32.store __stack_pointer($pop8), $pop13
call __multi3@FUNCTION, $5, $1, $2, $3, $4
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i32.const $push12=, 8
i32.add $push2=, $5, $pop12
i64.load $push3=, 0($pop2)
i64.store 0($pop1), $pop3
i64.load $push4=, 0($5)
i64.store 0($0), $pop4
i32.const $push11=, 0
i32.const $push9=, 16
i32.add $push10=, $5, $pop9
i32.store __stack_pointer($pop11), $pop10
return
.endfunc
.Lfunc_end2:
.size mul128, .Lfunc_end2-mul128
.globl sdiv128
.type sdiv128,@function
sdiv128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push8=, 0
i32.const $push5=, 0
i32.load $push6=, __stack_pointer($pop5)
i32.const $push7=, 16
i32.sub $push14=, $pop6, $pop7
tee_local $push13=, $5=, $pop14
i32.store __stack_pointer($pop8), $pop13
call __divti3@FUNCTION, $5, $1, $2, $3, $4
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i32.const $push12=, 8
i32.add $push2=, $5, $pop12
i64.load $push3=, 0($pop2)
i64.store 0($pop1), $pop3
i64.load $push4=, 0($5)
i64.store 0($0), $pop4
i32.const $push11=, 0
i32.const $push9=, 16
i32.add $push10=, $5, $pop9
i32.store __stack_pointer($pop11), $pop10
return
.endfunc
.Lfunc_end3:
.size sdiv128, .Lfunc_end3-sdiv128
.globl udiv128
.type udiv128,@function
udiv128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push8=, 0
i32.const $push5=, 0
i32.load $push6=, __stack_pointer($pop5)
i32.const $push7=, 16
i32.sub $push14=, $pop6, $pop7
tee_local $push13=, $5=, $pop14
i32.store __stack_pointer($pop8), $pop13
call __udivti3@FUNCTION, $5, $1, $2, $3, $4
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i32.const $push12=, 8
i32.add $push2=, $5, $pop12
i64.load $push3=, 0($pop2)
i64.store 0($pop1), $pop3
i64.load $push4=, 0($5)
i64.store 0($0), $pop4
i32.const $push11=, 0
i32.const $push9=, 16
i32.add $push10=, $5, $pop9
i32.store __stack_pointer($pop11), $pop10
return
.endfunc
.Lfunc_end4:
.size udiv128, .Lfunc_end4-udiv128
.globl srem128
.type srem128,@function
srem128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push8=, 0
i32.const $push5=, 0
i32.load $push6=, __stack_pointer($pop5)
i32.const $push7=, 16
i32.sub $push14=, $pop6, $pop7
tee_local $push13=, $5=, $pop14
i32.store __stack_pointer($pop8), $pop13
call __modti3@FUNCTION, $5, $1, $2, $3, $4
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i32.const $push12=, 8
i32.add $push2=, $5, $pop12
i64.load $push3=, 0($pop2)
i64.store 0($pop1), $pop3
i64.load $push4=, 0($5)
i64.store 0($0), $pop4
i32.const $push11=, 0
i32.const $push9=, 16
i32.add $push10=, $5, $pop9
i32.store __stack_pointer($pop11), $pop10
return
.endfunc
.Lfunc_end5:
.size srem128, .Lfunc_end5-srem128
.globl urem128
.type urem128,@function
urem128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push8=, 0
i32.const $push5=, 0
i32.load $push6=, __stack_pointer($pop5)
i32.const $push7=, 16
i32.sub $push14=, $pop6, $pop7
tee_local $push13=, $5=, $pop14
i32.store __stack_pointer($pop8), $pop13
call __umodti3@FUNCTION, $5, $1, $2, $3, $4
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i32.const $push12=, 8
i32.add $push2=, $5, $pop12
i64.load $push3=, 0($pop2)
i64.store 0($pop1), $pop3
i64.load $push4=, 0($5)
i64.store 0($0), $pop4
i32.const $push11=, 0
i32.const $push9=, 16
i32.add $push10=, $5, $pop9
i32.store __stack_pointer($pop11), $pop10
return
.endfunc
.Lfunc_end6:
.size urem128, .Lfunc_end6-urem128
.globl and128
.type and128,@function
and128:
.param i32, i64, i64, i64, i64
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i64.and $push0=, $2, $4
i64.store 0($pop2), $pop0
i64.and $push3=, $1, $3
i64.store 0($0), $pop3
return
.endfunc
.Lfunc_end7:
.size and128, .Lfunc_end7-and128
.globl or128
.type or128,@function
or128:
.param i32, i64, i64, i64, i64
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i64.or $push0=, $2, $4
i64.store 0($pop2), $pop0
i64.or $push3=, $1, $3
i64.store 0($0), $pop3
return
.endfunc
.Lfunc_end8:
.size or128, .Lfunc_end8-or128
.globl xor128
.type xor128,@function
xor128:
.param i32, i64, i64, i64, i64
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i64.xor $push0=, $2, $4
i64.store 0($pop2), $pop0
i64.xor $push3=, $1, $3
i64.store 0($0), $pop3
return
.endfunc
.Lfunc_end9:
.size xor128, .Lfunc_end9-xor128
.globl shl128
.type shl128,@function
shl128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push9=, 0
i32.const $push6=, 0
i32.load $push7=, __stack_pointer($pop6)
i32.const $push8=, 16
i32.sub $push15=, $pop7, $pop8
tee_local $push14=, $5=, $pop15
i32.store __stack_pointer($pop9), $pop14
i32.wrap/i64 $push0=, $3
call __ashlti3@FUNCTION, $5, $1, $2, $pop0
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i32.const $push13=, 8
i32.add $push3=, $5, $pop13
i64.load $push4=, 0($pop3)
i64.store 0($pop2), $pop4
i64.load $push5=, 0($5)
i64.store 0($0), $pop5
i32.const $push12=, 0
i32.const $push10=, 16
i32.add $push11=, $5, $pop10
i32.store __stack_pointer($pop12), $pop11
return
.endfunc
.Lfunc_end10:
.size shl128, .Lfunc_end10-shl128
.globl shr128
.type shr128,@function
shr128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push9=, 0
i32.const $push6=, 0
i32.load $push7=, __stack_pointer($pop6)
i32.const $push8=, 16
i32.sub $push15=, $pop7, $pop8
tee_local $push14=, $5=, $pop15
i32.store __stack_pointer($pop9), $pop14
i32.wrap/i64 $push0=, $3
call __lshrti3@FUNCTION, $5, $1, $2, $pop0
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i32.const $push13=, 8
i32.add $push3=, $5, $pop13
i64.load $push4=, 0($pop3)
i64.store 0($pop2), $pop4
i64.load $push5=, 0($5)
i64.store 0($0), $pop5
i32.const $push12=, 0
i32.const $push10=, 16
i32.add $push11=, $5, $pop10
i32.store __stack_pointer($pop12), $pop11
return
.endfunc
.Lfunc_end11:
.size shr128, .Lfunc_end11-shr128
.globl sar128
.type sar128,@function
sar128:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push9=, 0
i32.const $push6=, 0
i32.load $push7=, __stack_pointer($pop6)
i32.const $push8=, 16
i32.sub $push15=, $pop7, $pop8
tee_local $push14=, $5=, $pop15
i32.store __stack_pointer($pop9), $pop14
i32.wrap/i64 $push0=, $3
call __ashrti3@FUNCTION, $5, $1, $2, $pop0
i32.const $push1=, 8
i32.add $push2=, $0, $pop1
i32.const $push13=, 8
i32.add $push3=, $5, $pop13
i64.load $push4=, 0($pop3)
i64.store 0($pop2), $pop4
i64.load $push5=, 0($5)
i64.store 0($0), $pop5
i32.const $push12=, 0
i32.const $push10=, 16
i32.add $push11=, $5, $pop10
i32.store __stack_pointer($pop12), $pop11
return
.endfunc
.Lfunc_end12:
.size sar128, .Lfunc_end12-sar128
.globl clz128
.type clz128,@function
clz128:
.param i32, i64, i64
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i64.const $push2=, 0
i64.store 0($pop1), $pop2
i64.clz $push7=, $2
i64.clz $push4=, $1
i64.const $push5=, 64
i64.add $push6=, $pop4, $pop5
i64.const $push9=, 0
i64.ne $push3=, $2, $pop9
i64.select $push8=, $pop7, $pop6, $pop3
i64.store 0($0), $pop8
return
.endfunc
.Lfunc_end13:
.size clz128, .Lfunc_end13-clz128
.globl clz128_zero_undef
.type clz128_zero_undef,@function
clz128_zero_undef:
.param i32, i64, i64
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i64.const $push2=, 0
i64.store 0($pop1), $pop2
i64.clz $push7=, $2
i64.clz $push4=, $1
i64.const $push5=, 64
i64.add $push6=, $pop4, $pop5
i64.const $push9=, 0
i64.ne $push3=, $2, $pop9
i64.select $push8=, $pop7, $pop6, $pop3
i64.store 0($0), $pop8
return
.endfunc
.Lfunc_end14:
.size clz128_zero_undef, .Lfunc_end14-clz128_zero_undef
.globl ctz128
.type ctz128,@function
ctz128:
.param i32, i64, i64
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i64.const $push2=, 0
i64.store 0($pop1), $pop2
i64.ctz $push7=, $1
i64.ctz $push4=, $2
i64.const $push5=, 64
i64.add $push6=, $pop4, $pop5
i64.const $push9=, 0
i64.ne $push3=, $1, $pop9
i64.select $push8=, $pop7, $pop6, $pop3
i64.store 0($0), $pop8
return
.endfunc
.Lfunc_end15:
.size ctz128, .Lfunc_end15-ctz128
.globl ctz128_zero_undef
.type ctz128_zero_undef,@function
ctz128_zero_undef:
.param i32, i64, i64
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i64.const $push2=, 0
i64.store 0($pop1), $pop2
i64.ctz $push7=, $1
i64.ctz $push4=, $2
i64.const $push5=, 64
i64.add $push6=, $pop4, $pop5
i64.const $push9=, 0
i64.ne $push3=, $1, $pop9
i64.select $push8=, $pop7, $pop6, $pop3
i64.store 0($0), $pop8
return
.endfunc
.Lfunc_end16:
.size ctz128_zero_undef, .Lfunc_end16-ctz128_zero_undef
.globl popcnt128
.type popcnt128,@function
popcnt128:
.param i32, i64, i64
i32.const $push0=, 8
i32.add $push1=, $0, $pop0
i64.const $push2=, 0
i64.store 0($pop1), $pop2
i64.popcnt $push4=, $1
i64.popcnt $push3=, $2
i64.add $push5=, $pop4, $pop3
i64.store 0($0), $pop5
return
.endfunc
.Lfunc_end17:
.size popcnt128, .Lfunc_end17-popcnt128
.globl eqz128
.type eqz128,@function
eqz128:
.param i64, i64
.result i32
i64.or $push0=, $0, $1
i64.eqz $push1=, $pop0
return $pop1
.endfunc
.Lfunc_end18:
.size eqz128, .Lfunc_end18-eqz128
.globl rotl
.type rotl,@function
rotl:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push17=, 0
i32.const $push14=, 0
i32.load $push15=, __stack_pointer($pop14)
i32.const $push16=, 32
i32.sub $push28=, $pop15, $pop16
tee_local $push27=, $5=, $pop28
i32.store __stack_pointer($pop17), $pop27
i32.const $push21=, 16
i32.add $push22=, $5, $pop21
i32.wrap/i64 $push0=, $3
call __ashlti3@FUNCTION, $pop22, $1, $2, $pop0
i64.const $push1=, 128
i64.sub $push2=, $pop1, $3
i32.wrap/i64 $push3=, $pop2
call __lshrti3@FUNCTION, $5, $1, $2, $pop3
i32.const $push4=, 8
i32.add $push5=, $0, $pop4
i32.const $push23=, 16
i32.add $push24=, $5, $pop23
i32.const $push26=, 8
i32.add $push6=, $pop24, $pop26
i64.load $push7=, 0($pop6)
i32.const $push25=, 8
i32.add $push8=, $5, $pop25
i64.load $push9=, 0($pop8)
i64.or $push10=, $pop7, $pop9
i64.store 0($pop5), $pop10
i64.load $push11=, 16($5)
i64.load $push12=, 0($5)
i64.or $push13=, $pop11, $pop12
i64.store 0($0), $pop13
i32.const $push20=, 0
i32.const $push18=, 32
i32.add $push19=, $5, $pop18
i32.store __stack_pointer($pop20), $pop19
return
.endfunc
.Lfunc_end19:
.size rotl, .Lfunc_end19-rotl
.globl masked_rotl
.type masked_rotl,@function
masked_rotl:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push18=, 0
i32.const $push15=, 0
i32.load $push16=, __stack_pointer($pop15)
i32.const $push17=, 32
i32.sub $push31=, $pop16, $pop17
tee_local $push30=, $5=, $pop31
i32.store __stack_pointer($pop18), $pop30
i32.const $push22=, 16
i32.add $push23=, $5, $pop22
i64.const $push0=, 127
i64.and $push29=, $3, $pop0
tee_local $push28=, $3=, $pop29
i32.wrap/i64 $push1=, $pop28
call __ashlti3@FUNCTION, $pop23, $1, $2, $pop1
i64.const $push2=, 128
i64.sub $push3=, $pop2, $3
i32.wrap/i64 $push4=, $pop3
call __lshrti3@FUNCTION, $5, $1, $2, $pop4
i32.const $push5=, 8
i32.add $push6=, $0, $pop5
i32.const $push24=, 16
i32.add $push25=, $5, $pop24
i32.const $push27=, 8
i32.add $push7=, $pop25, $pop27
i64.load $push8=, 0($pop7)
i32.const $push26=, 8
i32.add $push9=, $5, $pop26
i64.load $push10=, 0($pop9)
i64.or $push11=, $pop8, $pop10
i64.store 0($pop6), $pop11
i64.load $push12=, 16($5)
i64.load $push13=, 0($5)
i64.or $push14=, $pop12, $pop13
i64.store 0($0), $pop14
i32.const $push21=, 0
i32.const $push19=, 32
i32.add $push20=, $5, $pop19
i32.store __stack_pointer($pop21), $pop20
return
.endfunc
.Lfunc_end20:
.size masked_rotl, .Lfunc_end20-masked_rotl
.globl rotr
.type rotr,@function
rotr:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push17=, 0
i32.const $push14=, 0
i32.load $push15=, __stack_pointer($pop14)
i32.const $push16=, 32
i32.sub $push28=, $pop15, $pop16
tee_local $push27=, $5=, $pop28
i32.store __stack_pointer($pop17), $pop27
i32.const $push21=, 16
i32.add $push22=, $5, $pop21
i32.wrap/i64 $push0=, $3
call __lshrti3@FUNCTION, $pop22, $1, $2, $pop0
i64.const $push1=, 128
i64.sub $push2=, $pop1, $3
i32.wrap/i64 $push3=, $pop2
call __ashlti3@FUNCTION, $5, $1, $2, $pop3
i32.const $push4=, 8
i32.add $push5=, $0, $pop4
i32.const $push23=, 16
i32.add $push24=, $5, $pop23
i32.const $push26=, 8
i32.add $push6=, $pop24, $pop26
i64.load $push7=, 0($pop6)
i32.const $push25=, 8
i32.add $push8=, $5, $pop25
i64.load $push9=, 0($pop8)
i64.or $push10=, $pop7, $pop9
i64.store 0($pop5), $pop10
i64.load $push11=, 16($5)
i64.load $push12=, 0($5)
i64.or $push13=, $pop11, $pop12
i64.store 0($0), $pop13
i32.const $push20=, 0
i32.const $push18=, 32
i32.add $push19=, $5, $pop18
i32.store __stack_pointer($pop20), $pop19
return
.endfunc
.Lfunc_end21:
.size rotr, .Lfunc_end21-rotr
.globl masked_rotr
.type masked_rotr,@function
masked_rotr:
.param i32, i64, i64, i64, i64
.local i32
i32.const $push18=, 0
i32.const $push15=, 0
i32.load $push16=, __stack_pointer($pop15)
i32.const $push17=, 32
i32.sub $push31=, $pop16, $pop17
tee_local $push30=, $5=, $pop31
i32.store __stack_pointer($pop18), $pop30
i32.const $push22=, 16
i32.add $push23=, $5, $pop22
i64.const $push0=, 127
i64.and $push29=, $3, $pop0
tee_local $push28=, $3=, $pop29
i32.wrap/i64 $push1=, $pop28
call __lshrti3@FUNCTION, $pop23, $1, $2, $pop1
i64.const $push2=, 128
i64.sub $push3=, $pop2, $3
i32.wrap/i64 $push4=, $pop3
call __ashlti3@FUNCTION, $5, $1, $2, $pop4
i32.const $push5=, 8
i32.add $push6=, $0, $pop5
i32.const $push24=, 16
i32.add $push25=, $5, $pop24
i32.const $push27=, 8
i32.add $push7=, $pop25, $pop27
i64.load $push8=, 0($pop7)
i32.const $push26=, 8
i32.add $push9=, $5, $pop26
i64.load $push10=, 0($pop9)
i64.or $push11=, $pop8, $pop10
i64.store 0($pop6), $pop11
i64.load $push12=, 16($5)
i64.load $push13=, 0($5)
i64.or $push14=, $pop12, $pop13
i64.store 0($0), $pop14
i32.const $push21=, 0
i32.const $push19=, 32
i32.add $push20=, $5, $pop19
i32.store __stack_pointer($pop21), $pop20
return
.endfunc
.Lfunc_end22:
.size masked_rotr, .Lfunc_end22-masked_rotr
|