@@ -457,35 +457,75 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
457
457
}
458
458
459
459
fn visit_i32_lt_s ( & mut self ) -> Self :: Output {
460
- todo ! ( )
460
+ self . translate_binary :: < i32 , bool > (
461
+ Instruction :: i32_lt_s,
462
+ Instruction :: i32_lt_s_imm16_rhs,
463
+ Instruction :: i32_lt_s_imm16_lhs,
464
+ wasm:: i32_lt_s,
465
+ )
461
466
}
462
467
463
468
fn visit_i32_lt_u ( & mut self ) -> Self :: Output {
464
- todo ! ( )
469
+ self . translate_binary :: < u32 , bool > (
470
+ Instruction :: i32_lt_u,
471
+ Instruction :: i32_lt_u_imm16_rhs,
472
+ Instruction :: i32_lt_u_imm16_lhs,
473
+ wasm:: i32_lt_u,
474
+ )
465
475
}
466
476
467
477
fn visit_i32_gt_s ( & mut self ) -> Self :: Output {
468
- todo ! ( )
478
+ self . translate_binary :: < i32 , bool > (
479
+ swap_ops ! ( Instruction :: i32_lt_s) ,
480
+ swap_ops ! ( Instruction :: i32_lt_s_imm16_lhs) ,
481
+ swap_ops ! ( Instruction :: i32_lt_s_imm16_rhs) ,
482
+ wasm:: i32_gt_s,
483
+ )
469
484
}
470
485
471
486
fn visit_i32_gt_u ( & mut self ) -> Self :: Output {
472
- todo ! ( )
487
+ self . translate_binary :: < u32 , bool > (
488
+ swap_ops ! ( Instruction :: i32_lt_u) ,
489
+ swap_ops ! ( Instruction :: i32_lt_u_imm16_lhs) ,
490
+ swap_ops ! ( Instruction :: i32_lt_u_imm16_rhs) ,
491
+ wasm:: i32_gt_u,
492
+ )
473
493
}
474
494
475
495
fn visit_i32_le_s ( & mut self ) -> Self :: Output {
476
- todo ! ( )
496
+ self . translate_binary :: < i32 , bool > (
497
+ Instruction :: i32_le_s,
498
+ Instruction :: i32_le_s_imm16_rhs,
499
+ Instruction :: i32_le_s_imm16_lhs,
500
+ wasm:: i32_le_s,
501
+ )
477
502
}
478
503
479
504
fn visit_i32_le_u ( & mut self ) -> Self :: Output {
480
- todo ! ( )
505
+ self . translate_binary :: < u32 , bool > (
506
+ Instruction :: i32_le_u,
507
+ Instruction :: i32_le_u_imm16_rhs,
508
+ Instruction :: i32_le_u_imm16_lhs,
509
+ wasm:: i32_le_u,
510
+ )
481
511
}
482
512
483
513
fn visit_i32_ge_s ( & mut self ) -> Self :: Output {
484
- todo ! ( )
514
+ self . translate_binary :: < i32 , bool > (
515
+ swap_ops ! ( Instruction :: i32_le_s) ,
516
+ swap_ops ! ( Instruction :: i32_le_s_imm16_lhs) ,
517
+ swap_ops ! ( Instruction :: i32_le_s_imm16_rhs) ,
518
+ wasm:: i32_ge_s,
519
+ )
485
520
}
486
521
487
522
fn visit_i32_ge_u ( & mut self ) -> Self :: Output {
488
- todo ! ( )
523
+ self . translate_binary :: < u32 , bool > (
524
+ swap_ops ! ( Instruction :: i32_le_u) ,
525
+ swap_ops ! ( Instruction :: i32_le_u_imm16_lhs) ,
526
+ swap_ops ! ( Instruction :: i32_le_u_imm16_rhs) ,
527
+ wasm:: i32_ge_u,
528
+ )
489
529
}
490
530
491
531
fn visit_i64_eqz ( & mut self ) -> Self :: Output {
@@ -511,35 +551,75 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
511
551
}
512
552
513
553
fn visit_i64_lt_s ( & mut self ) -> Self :: Output {
514
- todo ! ( )
554
+ self . translate_binary :: < i64 , bool > (
555
+ Instruction :: i64_lt_s,
556
+ Instruction :: i64_lt_s_imm16_rhs,
557
+ Instruction :: i64_lt_s_imm16_lhs,
558
+ wasm:: i64_lt_s,
559
+ )
515
560
}
516
561
517
562
fn visit_i64_lt_u ( & mut self ) -> Self :: Output {
518
- todo ! ( )
563
+ self . translate_binary :: < u64 , bool > (
564
+ Instruction :: i64_lt_u,
565
+ Instruction :: i64_lt_u_imm16_rhs,
566
+ Instruction :: i64_lt_u_imm16_lhs,
567
+ wasm:: i64_lt_u,
568
+ )
519
569
}
520
570
521
571
fn visit_i64_gt_s ( & mut self ) -> Self :: Output {
522
- todo ! ( )
572
+ self . translate_binary :: < i64 , bool > (
573
+ swap_ops ! ( Instruction :: i64_lt_s) ,
574
+ swap_ops ! ( Instruction :: i64_lt_s_imm16_lhs) ,
575
+ swap_ops ! ( Instruction :: i64_lt_s_imm16_rhs) ,
576
+ wasm:: i64_gt_s,
577
+ )
523
578
}
524
579
525
580
fn visit_i64_gt_u ( & mut self ) -> Self :: Output {
526
- todo ! ( )
581
+ self . translate_binary :: < u64 , bool > (
582
+ swap_ops ! ( Instruction :: i64_lt_u) ,
583
+ swap_ops ! ( Instruction :: i64_lt_u_imm16_lhs) ,
584
+ swap_ops ! ( Instruction :: i64_lt_u_imm16_rhs) ,
585
+ wasm:: i64_gt_u,
586
+ )
527
587
}
528
588
529
589
fn visit_i64_le_s ( & mut self ) -> Self :: Output {
530
- todo ! ( )
590
+ self . translate_binary :: < i64 , bool > (
591
+ Instruction :: i64_le_s,
592
+ Instruction :: i64_le_s_imm16_rhs,
593
+ Instruction :: i64_le_s_imm16_lhs,
594
+ wasm:: i64_le_s,
595
+ )
531
596
}
532
597
533
598
fn visit_i64_le_u ( & mut self ) -> Self :: Output {
534
- todo ! ( )
599
+ self . translate_binary :: < u64 , bool > (
600
+ Instruction :: i64_le_u,
601
+ Instruction :: i64_le_u_imm16_rhs,
602
+ Instruction :: i64_le_u_imm16_lhs,
603
+ wasm:: i64_le_u,
604
+ )
535
605
}
536
606
537
607
fn visit_i64_ge_s ( & mut self ) -> Self :: Output {
538
- todo ! ( )
608
+ self . translate_binary :: < i64 , bool > (
609
+ swap_ops ! ( Instruction :: i64_le_s) ,
610
+ swap_ops ! ( Instruction :: i64_le_s_imm16_lhs) ,
611
+ swap_ops ! ( Instruction :: i64_le_s_imm16_rhs) ,
612
+ wasm:: i64_ge_s,
613
+ )
539
614
}
540
615
541
616
fn visit_i64_ge_u ( & mut self ) -> Self :: Output {
542
- todo ! ( )
617
+ self . translate_binary :: < u64 , bool > (
618
+ swap_ops ! ( Instruction :: i64_le_u) ,
619
+ swap_ops ! ( Instruction :: i64_le_u_imm16_lhs) ,
620
+ swap_ops ! ( Instruction :: i64_le_u_imm16_rhs) ,
621
+ wasm:: i64_ge_u,
622
+ )
543
623
}
544
624
545
625
fn visit_f32_eq ( & mut self ) -> Self :: Output {
0 commit comments