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
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
|
<?php
declare(strict_types=1);
namespace Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Control;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Control\BlockType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Memory;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Numeric;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Parametric;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Reference;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Table;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Instructions\Instrs\Variable;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType;
abstract readonly class Instr
{
// Numeric instructions
final public static function F32Abs(): Numeric\F32Abs
{
return new Numeric\F32Abs();
}
final public static function F32Add(): Numeric\F32Add
{
return new Numeric\F32Add();
}
final public static function F32Ceil(): Numeric\F32Ceil
{
return new Numeric\F32Ceil();
}
/**
* @param F32 $value
*/
final public static function F32Const(float $value): Numeric\F32Const
{
return new Numeric\F32Const($value);
}
final public static function F32ConvertI32S(): Numeric\F32ConvertI32S
{
return new Numeric\F32ConvertI32S();
}
final public static function F32ConvertI32U(): Numeric\F32ConvertI32U
{
return new Numeric\F32ConvertI32U();
}
final public static function F32ConvertI64S(): Numeric\F32ConvertI64S
{
return new Numeric\F32ConvertI64S();
}
final public static function F32ConvertI64U(): Numeric\F32ConvertI64U
{
return new Numeric\F32ConvertI64U();
}
final public static function F32CopySign(): Numeric\F32CopySign
{
return new Numeric\F32CopySign();
}
final public static function F32DemoteF64(): Numeric\F32DemoteF64
{
return new Numeric\F32DemoteF64();
}
final public static function F32Div(): Numeric\F32Div
{
return new Numeric\F32Div();
}
final public static function F32Eq(): Numeric\F32Eq
{
return new Numeric\F32Eq();
}
final public static function F32Floor(): Numeric\F32Floor
{
return new Numeric\F32Floor();
}
final public static function F32Ge(): Numeric\F32Ge
{
return new Numeric\F32Ge();
}
final public static function F32Gt(): Numeric\F32Gt
{
return new Numeric\F32Gt();
}
final public static function F32Le(): Numeric\F32Le
{
return new Numeric\F32Le();
}
final public static function F32Lt(): Numeric\F32Lt
{
return new Numeric\F32Lt();
}
final public static function F32Max(): Numeric\F32Max
{
return new Numeric\F32Max();
}
final public static function F32Min(): Numeric\F32Min
{
return new Numeric\F32Min();
}
final public static function F32Mul(): Numeric\F32Mul
{
return new Numeric\F32Mul();
}
final public static function F32Ne(): Numeric\F32Ne
{
return new Numeric\F32Ne();
}
final public static function F32Nearest(): Numeric\F32Nearest
{
return new Numeric\F32Nearest();
}
final public static function F32Neg(): Numeric\F32Neg
{
return new Numeric\F32Neg();
}
final public static function F32ReinterpretI32(): Numeric\F32ReinterpretI32
{
return new Numeric\F32ReinterpretI32();
}
final public static function F32ReinterpretI64(): Numeric\F32ReinterpretI64
{
return new Numeric\F32ReinterpretI64();
}
final public static function F32Sqrt(): Numeric\F32Sqrt
{
return new Numeric\F32Sqrt();
}
final public static function F32Sub(): Numeric\F32Sub
{
return new Numeric\F32Sub();
}
final public static function F32Trunc(): Numeric\F32Trunc
{
return new Numeric\F32Trunc();
}
final public static function F64Abs(): Numeric\F64Abs
{
return new Numeric\F64Abs();
}
final public static function F64Add(): Numeric\F64Add
{
return new Numeric\F64Add();
}
final public static function F64Ceil(): Numeric\F64Ceil
{
return new Numeric\F64Ceil();
}
/**
* @param F64 $value
*/
final public static function F64Const(float $value): Numeric\F64Const
{
return new Numeric\F64Const($value);
}
final public static function F64ConvertI32S(): Numeric\F64ConvertI32S
{
return new Numeric\F64ConvertI32S();
}
final public static function F64ConvertI32U(): Numeric\F64ConvertI32U
{
return new Numeric\F64ConvertI32U();
}
final public static function F64ConvertI64S(): Numeric\F64ConvertI64S
{
return new Numeric\F64ConvertI64S();
}
final public static function F64ConvertI64U(): Numeric\F64ConvertI64U
{
return new Numeric\F64ConvertI64U();
}
final public static function F64CopySign(): Numeric\F64CopySign
{
return new Numeric\F64CopySign();
}
final public static function F64Div(): Numeric\F64Div
{
return new Numeric\F64Div();
}
final public static function F64Eq(): Numeric\F64Eq
{
return new Numeric\F64Eq();
}
final public static function F64Floor(): Numeric\F64Floor
{
return new Numeric\F64Floor();
}
final public static function F64Ge(): Numeric\F64Ge
{
return new Numeric\F64Ge();
}
final public static function F64Gt(): Numeric\F64Gt
{
return new Numeric\F64Gt();
}
final public static function F64Le(): Numeric\F64Le
{
return new Numeric\F64Le();
}
final public static function F64Lt(): Numeric\F64Lt
{
return new Numeric\F64Lt();
}
final public static function F64Max(): Numeric\F64Max
{
return new Numeric\F64Max();
}
final public static function F64Min(): Numeric\F64Min
{
return new Numeric\F64Min();
}
final public static function F64Mul(): Numeric\F64Mul
{
return new Numeric\F64Mul();
}
final public static function F64Ne(): Numeric\F64Ne
{
return new Numeric\F64Ne();
}
final public static function F64Nearest(): Numeric\F64Nearest
{
return new Numeric\F64Nearest();
}
final public static function F64Neg(): Numeric\F64Neg
{
return new Numeric\F64Neg();
}
final public static function F64PromoteF32(): Numeric\F64PromoteF32
{
return new Numeric\F64PromoteF32();
}
final public static function F64ReinterpretI32(): Numeric\F64ReinterpretI32
{
return new Numeric\F64ReinterpretI32();
}
final public static function F64ReinterpretI64(): Numeric\F64ReinterpretI64
{
return new Numeric\F64ReinterpretI64();
}
final public static function F64Sqrt(): Numeric\F64Sqrt
{
return new Numeric\F64Sqrt();
}
final public static function F64Sub(): Numeric\F64Sub
{
return new Numeric\F64Sub();
}
final public static function F64Trunc(): Numeric\F64Trunc
{
return new Numeric\F64Trunc();
}
final public static function I32Add(): Numeric\I32Add
{
return new Numeric\I32Add();
}
final public static function I32And(): Numeric\I32And
{
return new Numeric\I32And();
}
final public static function I32Clz(): Numeric\I32Clz
{
return new Numeric\I32Clz();
}
/**
* @param S64 $value
*/
final public static function I32Const(int $value): Numeric\I32Const
{
return new Numeric\I32Const($value);
}
final public static function I32Ctz(): Numeric\I32Ctz
{
return new Numeric\I32Ctz();
}
final public static function I32DivS(): Numeric\I32DivS
{
return new Numeric\I32DivS();
}
final public static function I32DivU(): Numeric\I32DivU
{
return new Numeric\I32DivU();
}
final public static function I32Eq(): Numeric\I32Eq
{
return new Numeric\I32Eq();
}
final public static function I32Eqz(): Numeric\I32Eqz
{
return new Numeric\I32Eqz();
}
final public static function I32Extend16S(): Numeric\I32Extend16S
{
return new Numeric\I32Extend16S();
}
final public static function I32Extend8S(): Numeric\I32Extend8S
{
return new Numeric\I32Extend8S();
}
final public static function I32GeS(): Numeric\I32GeS
{
return new Numeric\I32GeS();
}
final public static function I32GeU(): Numeric\I32GeU
{
return new Numeric\I32GeU();
}
final public static function I32GtS(): Numeric\I32GtS
{
return new Numeric\I32GtS();
}
final public static function I32GtU(): Numeric\I32GtU
{
return new Numeric\I32GtU();
}
final public static function I32LeS(): Numeric\I32LeS
{
return new Numeric\I32LeS();
}
final public static function I32LeU(): Numeric\I32LeU
{
return new Numeric\I32LeU();
}
final public static function I32LtS(): Numeric\I32LtS
{
return new Numeric\I32LtS();
}
final public static function I32LtU(): Numeric\I32LtU
{
return new Numeric\I32LtU();
}
final public static function I32Mul(): Numeric\I32Mul
{
return new Numeric\I32Mul();
}
final public static function I32Ne(): Numeric\I32Ne
{
return new Numeric\I32Ne();
}
final public static function I32Or(): Numeric\I32Or
{
return new Numeric\I32Or();
}
final public static function I32Popcnt(): Numeric\I32Popcnt
{
return new Numeric\I32Popcnt();
}
final public static function I32ReinterpretF32(): Numeric\I32ReinterpretF32
{
return new Numeric\I32ReinterpretF32();
}
final public static function I32ReinterpretF64(): Numeric\I32ReinterpretF64
{
return new Numeric\I32ReinterpretF64();
}
final public static function I32RemS(): Numeric\I32RemS
{
return new Numeric\I32RemS();
}
final public static function I32RemU(): Numeric\I32RemU
{
return new Numeric\I32RemU();
}
final public static function I32RotL(): Numeric\I32RotL
{
return new Numeric\I32RotL();
}
final public static function I32RotR(): Numeric\I32RotR
{
return new Numeric\I32RotR();
}
final public static function I32Shl(): Numeric\I32Shl
{
return new Numeric\I32Shl();
}
final public static function I32ShrS(): Numeric\I32ShrS
{
return new Numeric\I32ShrS();
}
final public static function I32ShrU(): Numeric\I32ShrU
{
return new Numeric\I32ShrU();
}
final public static function I32Sub(): Numeric\I32Sub
{
return new Numeric\I32Sub();
}
final public static function I32TruncF32S(): Numeric\I32TruncF32S
{
return new Numeric\I32TruncF32S();
}
final public static function I32TruncF32U(): Numeric\I32TruncF32U
{
return new Numeric\I32TruncF32U();
}
final public static function I32TruncF64S(): Numeric\I32TruncF64S
{
return new Numeric\I32TruncF64S();
}
final public static function I32TruncF64U(): Numeric\I32TruncF64U
{
return new Numeric\I32TruncF64U();
}
final public static function I32TruncSatF32S(): Numeric\I32TruncSatF32S
{
return new Numeric\I32TruncSatF32S();
}
final public static function I32TruncSatF32U(): Numeric\I32TruncSatF32U
{
return new Numeric\I32TruncSatF32U();
}
final public static function I32TruncSatF64S(): Numeric\I32TruncSatF64S
{
return new Numeric\I32TruncSatF64S();
}
final public static function I32TruncSatF64U(): Numeric\I32TruncSatF64U
{
return new Numeric\I32TruncSatF64U();
}
final public static function I32WrapI64(): Numeric\I32WrapI64
{
return new Numeric\I32WrapI64();
}
final public static function I32Xor(): Numeric\I32Xor
{
return new Numeric\I32Xor();
}
final public static function I64Add(): Numeric\I64Add
{
return new Numeric\I64Add();
}
final public static function I64And(): Numeric\I64And
{
return new Numeric\I64And();
}
final public static function I64Clz(): Numeric\I64Clz
{
return new Numeric\I64Clz();
}
/**
* @param S64 $value
*/
final public static function I64Const(int $value): Numeric\I64Const
{
return new Numeric\I64Const($value);
}
final public static function I64Ctz(): Numeric\I64Ctz
{
return new Numeric\I64Ctz();
}
final public static function I64DivS(): Numeric\I64DivS
{
return new Numeric\I64DivS();
}
final public static function I64DivU(): Numeric\I64DivU
{
return new Numeric\I64DivU();
}
final public static function I64Eq(): Numeric\I64Eq
{
return new Numeric\I64Eq();
}
final public static function I64Eqz(): Numeric\I64Eqz
{
return new Numeric\I64Eqz();
}
final public static function I64Extend16S(): Numeric\I64Extend16S
{
return new Numeric\I64Extend16S();
}
final public static function I64Extend32S(): Numeric\I64Extend32S
{
return new Numeric\I64Extend32S();
}
final public static function I64Extend8S(): Numeric\I64Extend8S
{
return new Numeric\I64Extend8S();
}
final public static function I64ExtendI32S(): Numeric\I64ExtendI32S
{
return new Numeric\I64ExtendI32S();
}
final public static function I64ExtendI32U(): Numeric\I64ExtendI32U
{
return new Numeric\I64ExtendI32U();
}
final public static function I64GeS(): Numeric\I64GeS
{
return new Numeric\I64GeS();
}
final public static function I64GeU(): Numeric\I64GeU
{
return new Numeric\I64GeU();
}
final public static function I64GtS(): Numeric\I64GtS
{
return new Numeric\I64GtS();
}
final public static function I64GtU(): Numeric\I64GtU
{
return new Numeric\I64GtU();
}
final public static function I64LeS(): Numeric\I64LeS
{
return new Numeric\I64LeS();
}
final public static function I64LeU(): Numeric\I64LeU
{
return new Numeric\I64LeU();
}
final public static function I64LtS(): Numeric\I64LtS
{
return new Numeric\I64LtS();
}
final public static function I64LtU(): Numeric\I64LtU
{
return new Numeric\I64LtU();
}
final public static function I64Mul(): Numeric\I64Mul
{
return new Numeric\I64Mul();
}
final public static function I64Ne(): Numeric\I64Ne
{
return new Numeric\I64Ne();
}
final public static function I64Or(): Numeric\I64Or
{
return new Numeric\I64Or();
}
final public static function I64Popcnt(): Numeric\I64Popcnt
{
return new Numeric\I64Popcnt();
}
final public static function I64ReinterpretF32(): Numeric\I64ReinterpretF32
{
return new Numeric\I64ReinterpretF32();
}
final public static function I64ReinterpretF64(): Numeric\I64ReinterpretF64
{
return new Numeric\I64ReinterpretF64();
}
final public static function I64RemS(): Numeric\I64RemS
{
return new Numeric\I64RemS();
}
final public static function I64RemU(): Numeric\I64RemU
{
return new Numeric\I64RemU();
}
final public static function I64RotL(): Numeric\I64RotL
{
return new Numeric\I64RotL();
}
final public static function I64RotR(): Numeric\I64RotR
{
return new Numeric\I64RotR();
}
final public static function I64Shl(): Numeric\I64Shl
{
return new Numeric\I64Shl();
}
final public static function I64ShrS(): Numeric\I64ShrS
{
return new Numeric\I64ShrS();
}
final public static function I64ShrU(): Numeric\I64ShrU
{
return new Numeric\I64ShrU();
}
final public static function I64Sub(): Numeric\I64Sub
{
return new Numeric\I64Sub();
}
final public static function I64TruncF32S(): Numeric\I64TruncF32S
{
return new Numeric\I64TruncF32S();
}
final public static function I64TruncF32U(): Numeric\I64TruncF32U
{
return new Numeric\I64TruncF32U();
}
final public static function I64TruncF64S(): Numeric\I64TruncF64S
{
return new Numeric\I64TruncF64S();
}
final public static function I64TruncF64U(): Numeric\I64TruncF64U
{
return new Numeric\I64TruncF64U();
}
final public static function I64TruncSatF32S(): Numeric\I64TruncSatF32S
{
return new Numeric\I64TruncSatF32S();
}
final public static function I64TruncSatF32U(): Numeric\I64TruncSatF32U
{
return new Numeric\I64TruncSatF32U();
}
final public static function I64TruncSatF64S(): Numeric\I64TruncSatF64S
{
return new Numeric\I64TruncSatF64S();
}
final public static function I64TruncSatF64U(): Numeric\I64TruncSatF64U
{
return new Numeric\I64TruncSatF64U();
}
final public static function I64Xor(): Numeric\I64Xor
{
return new Numeric\I64Xor();
}
// Reference instructions
final public static function RefFunc(int $func): Reference\RefFunc
{
return new Reference\RefFunc($func);
}
final public static function RefIsNull(): Reference\RefIsNull
{
return new Reference\RefIsNull();
}
/**
* @param ValType::FuncRef|ValType::ExternRef $type
*/
final public static function RefNull(ValType $type): Reference\RefNull
{
return new Reference\RefNull($type);
}
// Parametric instructions
final public static function Drop(): Parametric\Drop
{
return new Parametric\Drop();
}
/**
* @param list<ValType> $types
*/
final public static function Select(array $types): Parametric\Select
{
return new Parametric\Select($types);
}
// Variable instructions
final public static function GlobalGet(int $var): Variable\GlobalGet
{
return new Variable\GlobalGet($var);
}
final public static function GlobalSet(int $var): Variable\GlobalSet
{
return new Variable\GlobalSet($var);
}
final public static function LocalGet(int $var): Variable\LocalGet
{
return new Variable\LocalGet($var);
}
final public static function LocalSet(int $var): Variable\LocalSet
{
return new Variable\LocalSet($var);
}
final public static function LocalTee(int $var): Variable\LocalTee
{
return new Variable\LocalTee($var);
}
// Table instructions
final public static function ElemDrop(int $elem): Table\ElemDrop
{
return new Table\ElemDrop($elem);
}
final public static function TableCopy(int $to, int $from): Table\TableCopy
{
return new Table\TableCopy($to, $from);
}
final public static function TableFill(int $table): Table\TableFill
{
return new Table\TableFill($table);
}
final public static function TableGet(int $table): Table\TableGet
{
return new Table\TableGet($table);
}
final public static function TableGrow(int $table): Table\TableGrow
{
return new Table\TableGrow($table);
}
final public static function TableInit(int $to, int $from): Table\TableInit
{
return new Table\TableInit($to, $from);
}
final public static function TableSet(int $table): Table\TableSet
{
return new Table\TableSet($table);
}
final public static function TableSize(int $table): Table\TableSize
{
return new Table\TableSize($table);
}
// Memory instructions
final public static function DataDrop(int $data): Memory\DataDrop
{
return new Memory\DataDrop($data);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function F32Load(int $offset, int $align): Memory\F32Load
{
return new Memory\F32Load($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function F32Store(int $offset, int $align): Memory\F32Store
{
return new Memory\F32Store($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function F64Load(int $offset, int $align): Memory\F64Load
{
return new Memory\F64Load($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function F64Store(int $offset, int $align): Memory\F64Store
{
return new Memory\F64Store($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Load(int $offset, int $align): Memory\I32Load
{
return new Memory\I32Load($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Load16S(int $offset, int $align): Memory\I32Load16S
{
return new Memory\I32Load16S($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Load16U(int $offset, int $align): Memory\I32Load16U
{
return new Memory\I32Load16U($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Load8S(int $offset, int $align): Memory\I32Load8S
{
return new Memory\I32Load8S($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Load8U(int $offset, int $align): Memory\I32Load8U
{
return new Memory\I32Load8U($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Store(int $offset, int $align): Memory\I32Store
{
return new Memory\I32Store($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Store16(int $offset, int $align): Memory\I32Store16
{
return new Memory\I32Store16($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I32Store8(int $offset, int $align): Memory\I32Store8
{
return new Memory\I32Store8($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load(int $offset, int $align): Memory\I64Load
{
return new Memory\I64Load($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load16S(int $offset, int $align): Memory\I64Load16S
{
return new Memory\I64Load16S($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load16U(int $offset, int $align): Memory\I64Load16U
{
return new Memory\I64Load16U($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load32S(int $offset, int $align): Memory\I64Load32S
{
return new Memory\I64Load32S($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load32U(int $offset, int $align): Memory\I64Load32U
{
return new Memory\I64Load32U($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load8S(int $offset, int $align): Memory\I64Load8S
{
return new Memory\I64Load8S($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Load8U(int $offset, int $align): Memory\I64Load8U
{
return new Memory\I64Load8U($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Store(int $offset, int $align): Memory\I64Store
{
return new Memory\I64Store($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Store16(int $offset, int $align): Memory\I64Store16
{
return new Memory\I64Store16($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Store32(int $offset, int $align): Memory\I64Store32
{
return new Memory\I64Store32($offset, $align);
}
/**
* @param U32 $offset
* @param U32 $align
*/
final public static function I64Store8(int $offset, int $align): Memory\I64Store8
{
return new Memory\I64Store8($offset, $align);
}
final public static function MemoryCopy(): Memory\MemoryCopy
{
return new Memory\MemoryCopy();
}
final public static function MemoryFill(): Memory\MemoryFill
{
return new Memory\MemoryFill();
}
final public static function MemoryGrow(): Memory\MemoryGrow
{
return new Memory\MemoryGrow();
}
final public static function MemoryInit(int $data): Memory\MemoryInit
{
return new Memory\MemoryInit($data);
}
final public static function MemorySize(): Memory\MemorySize
{
return new Memory\MemorySize();
}
// Control instructions
/**
* @param list<Instr> $body
*/
final public static function Block(BlockType $type, array $body): Control\Block
{
return new Control\Block($type, $body);
}
final public static function Br(int $label): Control\Br
{
return new Control\Br($label);
}
final public static function BrIf(int $label): Control\BrIf
{
return new Control\BrIf($label);
}
/**
* @param list<int> $labelTable
*/
final public static function BrTable(array $labelTable, int $defaultLabel): Control\BrTable
{
return new Control\BrTable($labelTable, $defaultLabel);
}
final public static function Call(int $func): Control\Call
{
return new Control\Call($func);
}
final public static function CallIndirect(int $funcTable, int $type): Control\CallIndirect
{
return new Control\CallIndirect($funcTable, $type);
}
final public static function Else_(): Control\Else_
{
return new Control\Else_();
}
final public static function End(): Control\End
{
return new Control\End();
}
/**
* @param list<Instr> $thenBody
* @param list<Instr> $elseBody
*/
final public static function If_(BlockType $type, array $thenBody, array $elseBody): Control\If_
{
return new Control\If_($type, $thenBody, $elseBody);
}
/**
* @param list<Instr> $body
*/
final public static function Loop(BlockType $type, array $body): Control\Loop
{
return new Control\Loop($type, $body);
}
final public static function Nop(): Control\Nop
{
return new Control\Nop();
}
final public static function Return_(): Control\Return_
{
return new Control\Return_();
}
final public static function Unreachable(): Control\Unreachable
{
return new Control\Unreachable();
}
abstract public static function opName(): string;
}
|