tinywasm 0.9.0-alpha.1

A tiny WebAssembly interpreter
Documentation
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
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
use super::super::num_helpers::TinywasmFloatExt;
use super::Value128;
use super::utils::*;

#[cfg(not(feature = "std"))]
use super::super::no_std_floats::NoStdFloatExt;
#[cfg(target_arch = "wasm32")]
use core::arch::wasm32 as wasm;
#[cfg(target_arch = "wasm64")]
use core::arch::wasm64 as wasm;
#[cfg(all(
    feature = "simd-x86",
    target_arch = "x86_64",
    target_feature = "sse4.2",
    target_feature = "avx",
    target_feature = "avx2",
    target_feature = "bmi1",
    target_feature = "bmi2",
    target_feature = "fma",
    target_feature = "lzcnt",
    target_feature = "movbe",
    target_feature = "popcnt"
))]
use core::arch::x86_64 as x86;

impl Value128 {
    #[doc(alias = "v128.any_true")]
    pub fn v128_any_true(self) -> bool {
        simd_impl! {
            wasm => { wasm::v128_any_true(self.to_wasm_v128()) }
            generic => { self.0.iter().any(|&b| b != 0) }
        }
    }

    #[doc(alias = "v128.not")]
    pub fn v128_not(self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_not(self.to_wasm_v128())) }
            generic => { Self(self.0.map(|b| !b)) }
        }
    }

    #[doc(alias = "v128.and")]
    pub fn v128_and(self, rhs: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_and(self.to_wasm_v128(), rhs.to_wasm_v128())) }
            generic => { (i128::from_le_bytes(self.0) & i128::from_le_bytes(rhs.0)).into() }
        }
    }

    #[doc(alias = "v128.andnot")]
    pub fn v128_andnot(self, rhs: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_andnot(self.to_wasm_v128(), rhs.to_wasm_v128())) }
            generic => { (i128::from_le_bytes(self.0) & !i128::from_le_bytes(rhs.0)).into() }
        }
    }

    #[doc(alias = "v128.or")]
    pub fn v128_or(self, rhs: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_or(self.to_wasm_v128(), rhs.to_wasm_v128())) }
            generic => { (i128::from_le_bytes(self.0) | i128::from_le_bytes(rhs.0)).into() }
        }
    }

    #[doc(alias = "v128.xor")]
    pub fn v128_xor(self, rhs: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_xor(self.to_wasm_v128(), rhs.to_wasm_v128())) }
            generic => { (i128::from_le_bytes(self.0) ^ i128::from_le_bytes(rhs.0)).into() }
        }
    }

    #[doc(alias = "v128.bitselect")]
    pub fn v128_bitselect(v1: Self, v2: Self, c: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::v128_bitselect(v1.to_wasm_v128(), v2.to_wasm_v128(), c.to_wasm_v128())) }
            generic => { ((i128::from_le_bytes(v1.0) & i128::from_le_bytes(c.0)) | (i128::from_le_bytes(v2.0) & !i128::from_le_bytes(c.0))).into() }
        }
    }

    #[doc(alias = "v128.load8x8_s")]
    pub const fn v128_load8x8_s(src: [u8; 8]) -> Self {
        Self::from_i16x8([
            src[0] as i8 as i16,
            src[1] as i8 as i16,
            src[2] as i8 as i16,
            src[3] as i8 as i16,
            src[4] as i8 as i16,
            src[5] as i8 as i16,
            src[6] as i8 as i16,
            src[7] as i8 as i16,
        ])
    }

    #[doc(alias = "v128.load8x8_u")]
    pub const fn v128_load8x8_u(src: [u8; 8]) -> Self {
        Self::from_u16x8([
            src[0] as u16,
            src[1] as u16,
            src[2] as u16,
            src[3] as u16,
            src[4] as u16,
            src[5] as u16,
            src[6] as u16,
            src[7] as u16,
        ])
    }

    #[doc(alias = "v128.load16x4_s")]
    pub const fn v128_load16x4_s(src: [u8; 8]) -> Self {
        Self::from_i32x4([
            i16::from_le_bytes([src[0], src[1]]) as i32,
            i16::from_le_bytes([src[2], src[3]]) as i32,
            i16::from_le_bytes([src[4], src[5]]) as i32,
            i16::from_le_bytes([src[6], src[7]]) as i32,
        ])
    }

    #[doc(alias = "v128.load16x4_u")]
    pub const fn v128_load16x4_u(src: [u8; 8]) -> Self {
        Self::from_u32x4([
            u16::from_le_bytes([src[0], src[1]]) as u32,
            u16::from_le_bytes([src[2], src[3]]) as u32,
            u16::from_le_bytes([src[4], src[5]]) as u32,
            u16::from_le_bytes([src[6], src[7]]) as u32,
        ])
    }

    #[doc(alias = "v128.load32x2_s")]
    pub const fn v128_load32x2_s(src: [u8; 8]) -> Self {
        Self::from_i64x2([
            i32::from_le_bytes([src[0], src[1], src[2], src[3]]) as i64,
            i32::from_le_bytes([src[4], src[5], src[6], src[7]]) as i64,
        ])
    }

    #[doc(alias = "v128.load32x2_u")]
    pub const fn v128_load32x2_u(src: [u8; 8]) -> Self {
        Self::from_u64x2([
            u32::from_le_bytes([src[0], src[1], src[2], src[3]]) as u64,
            u32::from_le_bytes([src[4], src[5], src[6], src[7]]) as u64,
        ])
    }

    #[doc(alias = "i8x16.swizzle")]
    pub fn i8x16_swizzle(self, s: Self) -> Self {
        simd_impl! {
            wasm => { Self::from_wasm_v128(wasm::i8x16_swizzle(self.to_wasm_v128(), s.to_wasm_v128())) }
            x86 => {
                let a = self.0;
                let idx = s.0;
                let mut mask = [0u8; 16];
                for i in 0..16 {
                    let j = idx[i];
                    mask[i] = if j < 16 { j & 0x0f } else { 0x80 };
                }

                // SAFETY: `a`, `mask`, and `out` are valid 16-byte buffers, and `_mm_loadu/_mm_storeu` support unaligned accesses.
                #[allow(unsafe_code)]
                let out = unsafe {
                    let a_vec = x86::_mm_loadu_si128(a.as_ptr().cast::<x86::__m128i>());
                    let mask_vec = x86::_mm_loadu_si128(mask.as_ptr().cast::<x86::__m128i>());
                    let result = x86::_mm_shuffle_epi8(a_vec, mask_vec);
                    let mut out = [0u8; 16];
                    x86::_mm_storeu_si128(out.as_mut_ptr().cast::<x86::__m128i>(), result);
                    out
                };
                Self(out)
            }
            generic => {
                let a = self.0;
                let idx = s.0;
                let mut out = [0u8; 16];
                for i in 0..16 {
                    let j = idx[i];
                    let lane = a[(j & 0x0f) as usize];
                    out[i] = if j < 16 { lane } else { 0 };
                }
                Self(out)
            }
        }
    }

    #[doc(alias = "i8x16.relaxed_swizzle")]
    pub fn i8x16_relaxed_swizzle(self, s: Self) -> Self {
        self.i8x16_swizzle(s)
    }

    #[doc(alias = "i8x16.shuffle")]
    pub fn i8x16_shuffle(a: Self, b: Self, idx: Self) -> Self {
        simd_impl! {
            x86 => {
                let a_bytes = a.0;
                let b_bytes = b.0;
                let idx = idx.0;
                let mut mask_a = [0u8; 16];
                let mut mask_b = [0u8; 16];
                for i in 0..16 {
                    let j = idx[i] & 31;
                    mask_a[i] = if j < 16 { j } else { 0x80 };
                    mask_b[i] = if j < 16 { 0x80 } else { j & 0x0f };
                }

                // SAFETY: all inputs are valid 16-byte buffers, and `_mm_loadu/_mm_storeu` support unaligned accesses.
                #[allow(unsafe_code)]
                let out = unsafe {
                    let a_vec = x86::_mm_loadu_si128(a_bytes.as_ptr().cast::<x86::__m128i>());
                    let b_vec = x86::_mm_loadu_si128(b_bytes.as_ptr().cast::<x86::__m128i>());
                    let mask_a_vec = x86::_mm_loadu_si128(mask_a.as_ptr().cast::<x86::__m128i>());
                    let mask_b_vec = x86::_mm_loadu_si128(mask_b.as_ptr().cast::<x86::__m128i>());
                    let a_part = x86::_mm_shuffle_epi8(a_vec, mask_a_vec);
                    let b_part = x86::_mm_shuffle_epi8(b_vec, mask_b_vec);
                    let result = x86::_mm_or_si128(a_part, b_part);
                    let mut out = [0u8; 16];
                    x86::_mm_storeu_si128(out.as_mut_ptr().cast::<x86::__m128i>(), result);
                    out
                };
                Self(out)
            }
            generic => {
                let a_bytes = a.0;
                let b_bytes = b.0;
                let idx = idx.0;
                let mut out = [0u8; 16];
                for i in 0..16 {
                    let j = idx[i] & 31;
                    out[i] = if j < 16 { a_bytes[j as usize] } else { b_bytes[(j & 0x0f) as usize] };
                }
                Self(out)
            }
        }
    }

    #[doc(alias = "i8x16.splat")]
    pub fn splat_i8(src: i8) -> Self {
        Self([src as u8; 16])
    }

    #[doc(alias = "i8x16.replace_lane")]
    pub fn i8x16_replace_lane(self, lane: u8, value: i8) -> Self {
        self.replace_lane_bytes::<1>(lane, [value as u8], 16)
    }

    #[doc(alias = "i16x8.replace_lane")]
    pub fn i16x8_replace_lane(self, lane: u8, value: i16) -> Self {
        self.replace_lane_bytes::<2>(lane, value.to_le_bytes(), 8)
    }

    #[doc(alias = "i32x4.replace_lane")]
    pub fn i32x4_replace_lane(self, lane: u8, value: i32) -> Self {
        self.replace_lane_bytes::<4>(lane, value.to_le_bytes(), 4)
    }

    #[doc(alias = "i64x2.replace_lane")]
    pub fn i64x2_replace_lane(self, lane: u8, value: i64) -> Self {
        self.replace_lane_bytes::<8>(lane, value.to_le_bytes(), 2)
    }

    #[doc(alias = "f32x4.replace_lane")]
    pub fn f32x4_replace_lane(self, lane: u8, value: f32) -> Self {
        self.replace_lane_bytes::<4>(lane, value.to_bits().to_le_bytes(), 4)
    }

    #[doc(alias = "f64x2.replace_lane")]
    pub fn f64x2_replace_lane(self, lane: u8, value: f64) -> Self {
        self.replace_lane_bytes::<8>(lane, value.to_bits().to_le_bytes(), 2)
    }

    #[doc(alias = "i8x16.all_true")]
    pub fn i8x16_all_true(self) -> bool {
        self.0.iter().all(|&b| b != 0)
    }

    #[doc(alias = "i16x8.all_true")]
    pub fn i16x8_all_true(self) -> bool {
        self.0.chunks_exact(2).map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])).all(|x| x != 0)
    }

    #[doc(alias = "i32x4.all_true")]
    pub fn i32x4_all_true(self) -> bool {
        self.0.chunks_exact(4).map(|chunk| u32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]])).all(|x| x != 0)
    }

    #[doc(alias = "i64x2.all_true")]
    pub fn i64x2_all_true(self) -> bool {
        self.0
            .chunks_exact(8)
            .map(|chunk| {
                u64::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]])
            })
            .all(|x| x != 0)
    }

    #[doc(alias = "i8x16.bitmask")]
    pub fn i8x16_bitmask(self) -> u32 {
        let bytes = self.0;
        let mut mask = 0u32;
        for (i, byte) in bytes.into_iter().enumerate() {
            if (byte & 0x80) != 0 {
                mask |= 1u32 << i;
            }
        }
        mask
    }

    #[doc(alias = "i16x8.bitmask")]
    pub fn i16x8_bitmask(self) -> u32 {
        let bytes = self.0;
        let mut mask = 0u32;
        for (i, lane) in bytes.chunks_exact(2).enumerate() {
            if (lane[1] & 0x80) != 0 {
                mask |= 1u32 << i;
            }
        }
        mask
    }

    #[doc(alias = "i32x4.bitmask")]
    pub fn i32x4_bitmask(self) -> u32 {
        let bytes = self.0;
        let mut mask = 0u32;
        for (i, lane) in bytes.chunks_exact(4).enumerate() {
            if (lane[3] & 0x80) != 0 {
                mask |= 1u32 << i;
            }
        }
        mask
    }

    #[doc(alias = "i64x2.bitmask")]
    pub fn i64x2_bitmask(self) -> u32 {
        let x = u128::from_le_bytes(self.0);
        (((x >> 63) & 1) as u32) | ((((x >> 127) & 1) as u32) << 1)
    }

    #[doc(alias = "i8x16.popcnt")]
    pub fn i8x16_popcnt(self) -> Self {
        let lanes = self.0;
        let mut out = [0u8; 16];
        for (dst, lane) in out.iter_mut().zip(lanes) {
            *dst = lane.count_ones() as u8;
        }
        Self(out)
    }

    #[doc(alias = "i8x16.shl")]
    pub fn i8x16_shl(self, shift: u32) -> Self {
        simd_shift_left!(self, shift, i8, 16, as_i8x16, from_i8x16, 7)
    }
    #[doc(alias = "i16x8.shl")]
    pub fn i16x8_shl(self, shift: u32) -> Self {
        simd_shift_left!(self, shift, i16, 8, as_i16x8, from_i16x8, 15)
    }
    #[doc(alias = "i32x4.shl")]
    pub fn i32x4_shl(self, shift: u32) -> Self {
        simd_shift_left!(self, shift, i32, 4, as_i32x4, from_i32x4, 31)
    }
    #[doc(alias = "i64x2.shl")]
    pub fn i64x2_shl(self, shift: u32) -> Self {
        simd_shift_left!(self, shift, i64, 2, as_i64x2, from_i64x2, 63)
    }

    #[doc(alias = "i8x16.shr_s")]
    pub fn i8x16_shr_s(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, i8, 16, as_i8x16, from_i8x16, 7)
    }
    #[doc(alias = "i16x8.shr_s")]
    pub fn i16x8_shr_s(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, i16, 8, as_i16x8, from_i16x8, 15)
    }
    #[doc(alias = "i32x4.shr_s")]
    pub fn i32x4_shr_s(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, i32, 4, as_i32x4, from_i32x4, 31)
    }
    #[doc(alias = "i64x2.shr_s")]
    pub fn i64x2_shr_s(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, i64, 2, as_i64x2, from_i64x2, 63)
    }

    #[doc(alias = "i8x16.shr_u")]
    pub fn i8x16_shr_u(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, u8, 16, as_u8x16, from_u8x16, 7)
    }
    #[doc(alias = "i16x8.shr_u")]
    pub fn i16x8_shr_u(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, u16, 8, as_u16x8, from_u16x8, 15)
    }
    #[doc(alias = "i32x4.shr_u")]
    pub fn i32x4_shr_u(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, u32, 4, as_u32x4, from_u32x4, 31)
    }
    #[doc(alias = "i64x2.shr_u")]
    pub fn i64x2_shr_u(self, shift: u32) -> Self {
        simd_shift_right!(self, shift, u64, 2, as_u64x2, from_u64x2, 63)
    }

    #[doc(alias = "i8x16.add")]
    pub fn i8x16_add(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i8x16_add, i8, 16, as_i8x16, from_i8x16, wrapping_add)
    }
    #[doc(alias = "i16x8.add")]
    pub fn i16x8_add(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i16x8_add, i16, 8, as_i16x8, from_i16x8, wrapping_add)
    }
    #[doc(alias = "i32x4.add")]
    pub fn i32x4_add(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i32x4_add, i32, 4, as_i32x4, from_i32x4, wrapping_add)
    }
    #[doc(alias = "i64x2.add")]
    pub fn i64x2_add(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i64x2_add, i64, 2, as_i64x2, from_i64x2, wrapping_add)
    }
    #[doc(alias = "i8x16.sub")]
    pub fn i8x16_sub(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i8x16_sub, i8, 16, as_i8x16, from_i8x16, wrapping_sub)
    }
    #[doc(alias = "i16x8.sub")]
    pub fn i16x8_sub(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i16x8_sub, i16, 8, as_i16x8, from_i16x8, wrapping_sub)
    }
    #[doc(alias = "i32x4.sub")]
    pub fn i32x4_sub(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i32x4_sub, i32, 4, as_i32x4, from_i32x4, wrapping_sub)
    }
    #[doc(alias = "i64x2.sub")]
    pub fn i64x2_sub(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i64x2_sub, i64, 2, as_i64x2, from_i64x2, wrapping_sub)
    }
    #[doc(alias = "i16x8.mul")]
    pub fn i16x8_mul(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i16x8_mul, i16, 8, as_i16x8, from_i16x8, wrapping_mul)
    }
    #[doc(alias = "i32x4.mul")]
    pub fn i32x4_mul(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i32x4_mul, i32, 4, as_i32x4, from_i32x4, wrapping_mul)
    }
    #[doc(alias = "i64x2.mul")]
    pub fn i64x2_mul(self, rhs: Self) -> Self {
        simd_wrapping_binop!(self, rhs, i64x2_mul, i64, 2, as_i64x2, from_i64x2, wrapping_mul)
    }

    #[doc(alias = "i8x16.add_sat_s")]
    pub fn i8x16_add_sat_s(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, i8x16_add_sat, i8, 16, as_i8x16, from_i8x16, saturating_add)
    }
    #[doc(alias = "i16x8.add_sat_s")]
    pub fn i16x8_add_sat_s(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, i16x8_add_sat, i16, 8, as_i16x8, from_i16x8, saturating_add)
    }
    #[doc(alias = "i8x16.add_sat_u")]
    pub fn i8x16_add_sat_u(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, u8x16_add_sat, u8, 16, as_u8x16, from_u8x16, saturating_add)
    }
    #[doc(alias = "i16x8.add_sat_u")]
    pub fn i16x8_add_sat_u(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, u16x8_add_sat, u16, 8, as_u16x8, from_u16x8, saturating_add)
    }
    #[doc(alias = "i8x16.sub_sat_s")]
    pub fn i8x16_sub_sat_s(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, i8x16_sub_sat, i8, 16, as_i8x16, from_i8x16, saturating_sub)
    }
    #[doc(alias = "i16x8.sub_sat_s")]
    pub fn i16x8_sub_sat_s(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, i16x8_sub_sat, i16, 8, as_i16x8, from_i16x8, saturating_sub)
    }
    #[doc(alias = "i8x16.sub_sat_u")]
    pub fn i8x16_sub_sat_u(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, u8x16_sub_sat, u8, 16, as_u8x16, from_u8x16, saturating_sub)
    }
    #[doc(alias = "i16x8.sub_sat_u")]
    pub fn i16x8_sub_sat_u(self, rhs: Self) -> Self {
        simd_sat_binop!(self, rhs, u16x8_sub_sat, u16, 8, as_u16x8, from_u16x8, saturating_sub)
    }

    #[doc(alias = "i8x16.avgr_u")]
    pub fn i8x16_avgr_u(self, rhs: Self) -> Self {
        simd_avgr_u!(self, rhs, u8x16_avgr, u8, u16, 16, as_u8x16, from_u8x16)
    }
    #[doc(alias = "i16x8.avgr_u")]
    pub fn i16x8_avgr_u(self, rhs: Self) -> Self {
        simd_avgr_u!(self, rhs, u16x8_avgr, u16, u32, 8, as_u16x8, from_u16x8)
    }

    #[doc(alias = "i8x16.narrow_i16x8_s")]
    pub fn i8x16_narrow_i16x8_s(a: Self, b: Self) -> Self {
        let av = a.as_i16x8();
        let bv = b.as_i16x8();
        let mut out = [0i8; 16];
        let (lo, hi) = out.split_at_mut(8);
        for ((dst_lo, dst_hi), (a_lane, b_lane)) in lo.iter_mut().zip(hi.iter_mut()).zip(av.into_iter().zip(bv)) {
            *dst_lo = saturate_i16_to_i8(a_lane);
            *dst_hi = saturate_i16_to_i8(b_lane);
        }
        Self::from_i8x16(out)
    }

    #[doc(alias = "i8x16.narrow_i16x8_u")]
    pub fn i8x16_narrow_i16x8_u(a: Self, b: Self) -> Self {
        let av = a.as_i16x8();
        let bv = b.as_i16x8();
        let mut out = [0u8; 16];
        let (lo, hi) = out.split_at_mut(8);
        for ((dst_lo, dst_hi), (a_lane, b_lane)) in lo.iter_mut().zip(hi.iter_mut()).zip(av.into_iter().zip(bv)) {
            *dst_lo = saturate_i16_to_u8(a_lane);
            *dst_hi = saturate_i16_to_u8(b_lane);
        }
        Self::from_u8x16(out)
    }

    #[doc(alias = "i16x8.narrow_i32x4_s")]
    pub fn i16x8_narrow_i32x4_s(a: Self, b: Self) -> Self {
        let av = a.as_i32x4();
        let bv = b.as_i32x4();
        let mut out = [0i16; 8];
        let (lo, hi) = out.split_at_mut(4);
        for ((dst_lo, dst_hi), (a_lane, b_lane)) in lo.iter_mut().zip(hi.iter_mut()).zip(av.into_iter().zip(bv)) {
            *dst_lo = saturate_i32_to_i16(a_lane);
            *dst_hi = saturate_i32_to_i16(b_lane);
        }
        Self::from_i16x8(out)
    }

    #[doc(alias = "i16x8.narrow_i32x4_u")]
    pub fn i16x8_narrow_i32x4_u(a: Self, b: Self) -> Self {
        let av = a.as_i32x4();
        let bv = b.as_i32x4();
        let mut out = [0u16; 8];
        let (lo, hi) = out.split_at_mut(4);
        for ((dst_lo, dst_hi), (a_lane, b_lane)) in lo.iter_mut().zip(hi.iter_mut()).zip(av.into_iter().zip(bv)) {
            *dst_lo = saturate_i32_to_u16(a_lane);
            *dst_hi = saturate_i32_to_u16(b_lane);
        }
        Self::from_u16x8(out)
    }

    #[doc(alias = "i16x8.extadd_pairwise_i8x16_s")]
    pub fn i16x8_extadd_pairwise_i8x16_s(self) -> Self {
        let lanes = self.as_i8x16();
        let mut out = [0i16; 8];
        for (dst, pair) in out.iter_mut().zip(lanes.as_chunks::<2>().0) {
            *dst = pair[0] as i16 + pair[1] as i16;
        }
        Self::from_i16x8(out)
    }

    #[doc(alias = "i16x8.extadd_pairwise_i8x16_u")]
    pub fn i16x8_extadd_pairwise_i8x16_u(self) -> Self {
        let lanes = self.as_u8x16();
        let mut out = [0u16; 8];
        for (dst, pair) in out.iter_mut().zip(lanes.as_chunks::<2>().0) {
            *dst = pair[0] as u16 + pair[1] as u16;
        }
        Self::from_u16x8(out)
    }

    #[doc(alias = "i32x4.extadd_pairwise_i16x8_s")]
    pub fn i32x4_extadd_pairwise_i16x8_s(self) -> Self {
        let lanes = self.as_i16x8();
        let mut out = [0i32; 4];
        for (dst, pair) in out.iter_mut().zip(lanes.as_chunks::<2>().0) {
            *dst = pair[0] as i32 + pair[1] as i32;
        }
        Self::from_i32x4(out)
    }

    #[doc(alias = "i32x4.extadd_pairwise_i16x8_u")]
    pub fn i32x4_extadd_pairwise_i16x8_u(self) -> Self {
        let lanes = self.as_u16x8();
        let mut out = [0u32; 4];
        for (dst, pair) in out.iter_mut().zip(lanes.as_chunks::<2>().0) {
            *dst = pair[0] as u32 + pair[1] as u32;
        }
        Self::from_u32x4(out)
    }

    #[doc(alias = "i16x8.extend_low_i8x16_s")]
    pub fn i16x8_extend_low_i8x16_s(self) -> Self {
        simd_extend_cast!(self, as_i8x16, from_i16x8, i16, 8, 0)
    }
    #[doc(alias = "i16x8.extend_low_i8x16_u")]
    pub fn i16x8_extend_low_i8x16_u(self) -> Self {
        simd_extend_cast!(self, as_u8x16, from_u16x8, u16, 8, 0)
    }
    #[doc(alias = "i16x8.extend_high_i8x16_s")]
    pub fn i16x8_extend_high_i8x16_s(self) -> Self {
        simd_extend_cast!(self, as_i8x16, from_i16x8, i16, 8, 8)
    }
    #[doc(alias = "i16x8.extend_high_i8x16_u")]
    pub fn i16x8_extend_high_i8x16_u(self) -> Self {
        simd_extend_cast!(self, as_u8x16, from_u16x8, u16, 8, 8)
    }
    #[doc(alias = "i32x4.extend_low_i16x8_s")]
    pub fn i32x4_extend_low_i16x8_s(self) -> Self {
        simd_extend_cast!(self, as_i16x8, from_i32x4, i32, 4, 0)
    }
    #[doc(alias = "i32x4.extend_low_i16x8_u")]
    pub fn i32x4_extend_low_i16x8_u(self) -> Self {
        simd_extend_cast!(self, as_u16x8, from_u32x4, u32, 4, 0)
    }
    #[doc(alias = "i32x4.extend_high_i16x8_s")]
    pub fn i32x4_extend_high_i16x8_s(self) -> Self {
        simd_extend_cast!(self, as_i16x8, from_i32x4, i32, 4, 4)
    }
    #[doc(alias = "i32x4.extend_high_i16x8_u")]
    pub fn i32x4_extend_high_i16x8_u(self) -> Self {
        simd_extend_cast!(self, as_u16x8, from_u32x4, u32, 4, 4)
    }
    #[doc(alias = "i64x2.extend_low_i32x4_s")]
    pub fn i64x2_extend_low_i32x4_s(self) -> Self {
        simd_extend_cast!(self, as_i32x4, from_i64x2, i64, 2, 0)
    }
    #[doc(alias = "i64x2.extend_low_i32x4_u")]
    pub fn i64x2_extend_low_i32x4_u(self) -> Self {
        simd_extend_cast!(self, as_u32x4, from_u64x2, u64, 2, 0)
    }
    #[doc(alias = "i64x2.extend_high_i32x4_s")]
    pub fn i64x2_extend_high_i32x4_s(self) -> Self {
        simd_extend_cast!(self, as_i32x4, from_i64x2, i64, 2, 2)
    }
    #[doc(alias = "i64x2.extend_high_i32x4_u")]
    pub fn i64x2_extend_high_i32x4_u(self) -> Self {
        simd_extend_cast!(self, as_u32x4, from_u64x2, u64, 2, 2)
    }

    #[doc(alias = "i16x8.extmul_low_i8x16_s")]
    pub fn i16x8_extmul_low_i8x16_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i8x16, from_i16x8, i16, 8, 0)
    }
    #[doc(alias = "i16x8.extmul_low_i8x16_u")]
    pub fn i16x8_extmul_low_i8x16_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u8x16, from_u16x8, u16, 8, 0)
    }
    #[doc(alias = "i16x8.extmul_high_i8x16_s")]
    pub fn i16x8_extmul_high_i8x16_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i8x16, from_i16x8, i16, 8, 8)
    }
    #[doc(alias = "i16x8.extmul_high_i8x16_u")]
    pub fn i16x8_extmul_high_i8x16_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u8x16, from_u16x8, u16, 8, 8)
    }
    #[doc(alias = "i32x4.extmul_low_i16x8_s")]
    pub fn i32x4_extmul_low_i16x8_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i16x8, from_i32x4, i32, 4, 0)
    }
    #[doc(alias = "i32x4.extmul_low_i16x8_u")]
    pub fn i32x4_extmul_low_i16x8_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u16x8, from_u32x4, u32, 4, 0)
    }
    #[doc(alias = "i32x4.extmul_high_i16x8_s")]
    pub fn i32x4_extmul_high_i16x8_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i16x8, from_i32x4, i32, 4, 4)
    }
    #[doc(alias = "i32x4.extmul_high_i16x8_u")]
    pub fn i32x4_extmul_high_i16x8_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u16x8, from_u32x4, u32, 4, 4)
    }
    #[doc(alias = "i64x2.extmul_low_i32x4_s")]
    pub fn i64x2_extmul_low_i32x4_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i32x4, from_i64x2, i64, 2, 0)
    }
    #[doc(alias = "i64x2.extmul_low_i32x4_u")]
    pub fn i64x2_extmul_low_i32x4_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u32x4, from_u64x2, u64, 2, 0)
    }
    #[doc(alias = "i64x2.extmul_high_i32x4_s")]
    pub fn i64x2_extmul_high_i32x4_s(self, rhs: Self) -> Self {
        simd_extmul_signed!(self, rhs, as_i32x4, from_i64x2, i64, 2, 2)
    }
    #[doc(alias = "i64x2.extmul_high_i32x4_u")]
    pub fn i64x2_extmul_high_i32x4_u(self, rhs: Self) -> Self {
        simd_extmul_unsigned!(self, rhs, as_u32x4, from_u64x2, u64, 2, 2)
    }

    #[doc(alias = "i16x8.q15mulr_sat_s")]
    pub fn i16x8_q15mulr_sat_s(self, rhs: Self) -> Self {
        let a = self.as_i16x8();
        let b = rhs.as_i16x8();
        let mut out = [0i16; 8];
        for ((dst, lhs), rhs) in out.iter_mut().zip(a).zip(b) {
            let r = ((lhs as i32 * rhs as i32) + (1 << 14)) >> 15; // 2^14: Q15 rounding
            *dst = if r > i16::MAX as i32 {
                i16::MAX
            } else if r < i16::MIN as i32 {
                i16::MIN
            } else {
                r as i16
            };
        }
        Self::from_i16x8(out)
    }

    #[doc(alias = "i32x4.dot_i16x8_s")]
    pub fn i32x4_dot_i16x8_s(self, rhs: Self) -> Self {
        let a = self.as_i16x8();
        let b = rhs.as_i16x8();
        let mut out = [0i32; 4];
        for (dst, (a_pair, b_pair)) in out.iter_mut().zip(a.as_chunks::<2>().0.iter().zip(b.as_chunks::<2>().0)) {
            *dst = (a_pair[0] as i32)
                .wrapping_mul(b_pair[0] as i32)
                .wrapping_add((a_pair[1] as i32).wrapping_mul(b_pair[1] as i32));
        }
        Self::from_i32x4(out)
    }

    #[doc(alias = "i8x16.relaxed_laneselect")]
    pub fn i8x16_relaxed_laneselect(v1: Self, v2: Self, c: Self) -> Self {
        Self::v128_bitselect(v1, v2, c)
    }

    #[doc(alias = "i16x8.relaxed_laneselect")]
    pub fn i16x8_relaxed_laneselect(v1: Self, v2: Self, c: Self) -> Self {
        Self::v128_bitselect(v1, v2, c)
    }

    #[doc(alias = "i32x4.relaxed_laneselect")]
    pub fn i32x4_relaxed_laneselect(v1: Self, v2: Self, c: Self) -> Self {
        Self::v128_bitselect(v1, v2, c)
    }

    #[doc(alias = "i64x2.relaxed_laneselect")]
    pub fn i64x2_relaxed_laneselect(v1: Self, v2: Self, c: Self) -> Self {
        Self::v128_bitselect(v1, v2, c)
    }

    #[doc(alias = "i16x8.relaxed_q15mulr_s")]
    pub fn i16x8_relaxed_q15mulr_s(self, rhs: Self) -> Self {
        self.i16x8_q15mulr_sat_s(rhs)
    }

    #[doc(alias = "i16x8.relaxed_dot_i8x16_i7x16_s")]
    pub fn i16x8_relaxed_dot_i8x16_i7x16_s(self, rhs: Self) -> Self {
        let a = self.as_i8x16();
        let b = rhs.as_i8x16();
        let mut out = [0i16; 8];

        for (dst, (a_pair, b_pair)) in out.iter_mut().zip(a.as_chunks::<2>().0.iter().zip(b.as_chunks::<2>().0)) {
            let prod0 = (a_pair[0] as i16) * (b_pair[0] as i16);
            let prod1 = (a_pair[1] as i16) * (b_pair[1] as i16);
            *dst = prod0.wrapping_add(prod1);
        }

        Self::from_i16x8(out)
    }

    #[doc(alias = "i32x4.relaxed_dot_i8x16_i7x16_add_s")]
    pub fn i32x4_relaxed_dot_i8x16_i7x16_add_s(self, rhs: Self, acc: Self) -> Self {
        let a = self.as_i8x16();
        let b = rhs.as_i8x16();
        let c = acc.as_i32x4();
        let mut out = [0i32; 4];

        for (i, dst) in out.iter_mut().enumerate() {
            let base = i * 4;
            let mut sum = 0i32;
            for j in 0..4 {
                sum = sum.wrapping_add((a[base + j] as i32).wrapping_mul(b[base + j] as i32));
            }
            *dst = sum.wrapping_add(c[i]);
        }

        Self::from_i32x4(out)
    }

    #[doc(alias = "i8x16.eq")]
    pub fn i8x16_eq(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i8x16_eq, i8, 16, as_i8x16, from_i8x16, ==)
    }
    #[doc(alias = "i16x8.eq")]
    pub fn i16x8_eq(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i16x8_eq, i16, 8, as_i16x8, from_i16x8, ==)
    }
    #[doc(alias = "i32x4.eq")]
    pub fn i32x4_eq(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i32x4_eq, i32, 4, as_i32x4, from_i32x4, ==)
    }
    #[doc(alias = "i64x2.eq")]
    pub fn i64x2_eq(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i64x2_eq, i64, 2, as_i64x2, from_i64x2, ==)
    }
    #[doc(alias = "i8x16.ne")]
    pub fn i8x16_ne(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i8x16_ne, i8, 16, as_i8x16, from_i8x16, !=)
    }
    #[doc(alias = "i16x8.ne")]
    pub fn i16x8_ne(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i16x8_ne, i16, 8, as_i16x8, from_i16x8, !=)
    }
    #[doc(alias = "i32x4.ne")]
    pub fn i32x4_ne(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i32x4_ne, i32, 4, as_i32x4, from_i32x4, !=)
    }
    #[doc(alias = "i64x2.ne")]
    pub fn i64x2_ne(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i64x2_ne, i64, 2, as_i64x2, from_i64x2, !=)
    }
    #[doc(alias = "i8x16.lt_s")]
    pub fn i8x16_lt_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i8x16_lt, i8, 16, as_i8x16, from_i8x16, <)
    }
    #[doc(alias = "i16x8.lt_s")]
    pub fn i16x8_lt_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i16x8_lt, i16, 8, as_i16x8, from_i16x8, <)
    }
    #[doc(alias = "i32x4.lt_s")]
    pub fn i32x4_lt_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i32x4_lt, i32, 4, as_i32x4, from_i32x4, <)
    }
    #[doc(alias = "i64x2.lt_s")]
    pub fn i64x2_lt_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i64x2_lt, i64, 2, as_i64x2, from_i64x2, <)
    }
    #[doc(alias = "i8x16.lt_u")]
    pub fn i8x16_lt_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u8x16_lt, i8, 16, as_u8x16, from_i8x16, <)
    }
    #[doc(alias = "i16x8.lt_u")]
    pub fn i16x8_lt_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u16x8_lt, i16, 8, as_u16x8, from_i16x8, <)
    }
    #[doc(alias = "i32x4.lt_u")]
    pub fn i32x4_lt_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u32x4_lt, i32, 4, as_u32x4, from_i32x4, <)
    }

    #[doc(alias = "i8x16.gt_s")]
    pub fn i8x16_gt_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i8x16_lt_s)
    }
    #[doc(alias = "i16x8.gt_s")]
    pub fn i16x8_gt_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i16x8_lt_s)
    }
    #[doc(alias = "i32x4.gt_s")]
    pub fn i32x4_gt_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i32x4_lt_s)
    }
    #[doc(alias = "i64x2.gt_s")]
    pub fn i64x2_gt_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i64x2_lt_s)
    }
    #[doc(alias = "i8x16.gt_u")]
    pub fn i8x16_gt_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i8x16_lt_u)
    }
    #[doc(alias = "i16x8.gt_u")]
    pub fn i16x8_gt_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i16x8_lt_u)
    }
    #[doc(alias = "i32x4.gt_u")]
    pub fn i32x4_gt_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i32x4_lt_u)
    }
    #[doc(alias = "i8x16.le_s")]
    pub fn i8x16_le_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i8x16_ge_s)
    }
    #[doc(alias = "i16x8.le_s")]
    pub fn i16x8_le_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i16x8_ge_s)
    }
    #[doc(alias = "i32x4.le_s")]
    pub fn i32x4_le_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i32x4_ge_s)
    }
    #[doc(alias = "i64x2.le_s")]
    pub fn i64x2_le_s(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i64x2_ge_s)
    }
    #[doc(alias = "i8x16.le_u")]
    pub fn i8x16_le_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i8x16_ge_u)
    }
    #[doc(alias = "i16x8.le_u")]
    pub fn i16x8_le_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i16x8_ge_u)
    }
    #[doc(alias = "i32x4.le_u")]
    pub fn i32x4_le_u(self, rhs: Self) -> Self {
        simd_cmp_delegate!(self, rhs, i32x4_ge_u)
    }

    #[doc(alias = "i8x16.ge_s")]
    pub fn i8x16_ge_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i8x16_ge, i8, 16, as_i8x16, from_i8x16, >=)
    }
    #[doc(alias = "i16x8.ge_s")]
    pub fn i16x8_ge_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i16x8_ge, i16, 8, as_i16x8, from_i16x8, >=)
    }
    #[doc(alias = "i32x4.ge_s")]
    pub fn i32x4_ge_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i32x4_ge, i32, 4, as_i32x4, from_i32x4, >=)
    }
    #[doc(alias = "i64x2.ge_s")]
    pub fn i64x2_ge_s(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, i64x2_ge, i64, 2, as_i64x2, from_i64x2, >=)
    }
    #[doc(alias = "i8x16.ge_u")]
    pub fn i8x16_ge_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u8x16_ge, i8, 16, as_u8x16, from_i8x16, >=)
    }
    #[doc(alias = "i16x8.ge_u")]
    pub fn i16x8_ge_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u16x8_ge, i16, 8, as_u16x8, from_i16x8, >=)
    }
    #[doc(alias = "i32x4.ge_u")]
    pub fn i32x4_ge_u(self, rhs: Self) -> Self {
        simd_cmp_mask!(self, rhs, u32x4_ge, i32, 4, as_u32x4, from_i32x4, >=)
    }

    #[doc(alias = "i8x16.abs")]
    pub fn i8x16_abs(self) -> Self {
        simd_abs_const!(self, i8, 16, as_i8x16, from_i8x16)
    }
    #[doc(alias = "i16x8.abs")]
    pub fn i16x8_abs(self) -> Self {
        simd_abs_const!(self, i16, 8, as_i16x8, from_i16x8)
    }
    #[doc(alias = "i32x4.abs")]
    pub fn i32x4_abs(self) -> Self {
        simd_abs_const!(self, i32, 4, as_i32x4, from_i32x4)
    }
    #[doc(alias = "i64x2.abs")]
    pub fn i64x2_abs(self) -> Self {
        simd_abs_const!(self, i64, 2, as_i64x2, from_i64x2)
    }

    #[doc(alias = "i8x16.neg")]
    pub fn i8x16_neg(self) -> Self {
        simd_neg!(self, i8x16_neg, i8, 16, as_i8x16, from_i8x16)
    }
    #[doc(alias = "i16x8.neg")]
    pub fn i16x8_neg(self) -> Self {
        simd_neg!(self, i16x8_neg, i16, 8, as_i16x8, from_i16x8)
    }
    #[doc(alias = "i32x4.neg")]
    pub fn i32x4_neg(self) -> Self {
        simd_neg!(self, i32x4_neg, i32, 4, as_i32x4, from_i32x4)
    }
    #[doc(alias = "i64x2.neg")]
    pub fn i64x2_neg(self) -> Self {
        simd_neg!(self, i64x2_neg, i64, 2, as_i64x2, from_i64x2)
    }

    #[doc(alias = "i8x16.min_s")]
    pub fn i8x16_min_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i8x16_min, i8, 16, as_i8x16, from_i8x16, <)
    }
    #[doc(alias = "i16x8.min_s")]
    pub fn i16x8_min_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i16x8_min, i16, 8, as_i16x8, from_i16x8, <)
    }
    #[doc(alias = "i32x4.min_s")]
    pub fn i32x4_min_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i32x4_min, i32, 4, as_i32x4, from_i32x4, <)
    }
    #[doc(alias = "i8x16.min_u")]
    pub fn i8x16_min_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u8x16_min, u8, 16, as_u8x16, from_u8x16, <)
    }
    #[doc(alias = "i16x8.min_u")]
    pub fn i16x8_min_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u16x8_min, u16, 8, as_u16x8, from_u16x8, <)
    }
    #[doc(alias = "i32x4.min_u")]
    pub fn i32x4_min_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u32x4_min, u32, 4, as_u32x4, from_u32x4, <)
    }
    #[doc(alias = "i8x16.max_s")]
    pub fn i8x16_max_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i8x16_max, i8, 16, as_i8x16, from_i8x16, >)
    }
    #[doc(alias = "i16x8.max_s")]
    pub fn i16x8_max_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i16x8_max, i16, 8, as_i16x8, from_i16x8, >)
    }
    #[doc(alias = "i32x4.max_s")]
    pub fn i32x4_max_s(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, i32x4_max, i32, 4, as_i32x4, from_i32x4, >)
    }
    #[doc(alias = "i8x16.max_u")]
    pub fn i8x16_max_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u8x16_max, u8, 16, as_u8x16, from_u8x16, >)
    }
    #[doc(alias = "i16x8.max_u")]
    pub fn i16x8_max_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u16x8_max, u16, 8, as_u16x8, from_u16x8, >)
    }
    #[doc(alias = "i32x4.max_u")]
    pub fn i32x4_max_u(self, rhs: Self) -> Self {
        simd_minmax!(self, rhs, u32x4_max, u32, 4, as_u32x4, from_u32x4, >)
    }

    #[doc(alias = "f32x4.eq")]
    pub fn f32x4_eq(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i32, 4, as_f32x4, from_i32x4, ==)
    }
    #[doc(alias = "f64x2.eq")]
    pub fn f64x2_eq(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i64, 2, as_f64x2, from_i64x2, ==)
    }
    #[doc(alias = "f32x4.ne")]
    pub fn f32x4_ne(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i32, 4, as_f32x4, from_i32x4, !=)
    }
    #[doc(alias = "f64x2.ne")]
    pub fn f64x2_ne(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i64, 2, as_f64x2, from_i64x2, !=)
    }
    #[doc(alias = "f32x4.lt")]
    pub fn f32x4_lt(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i32, 4, as_f32x4, from_i32x4, <)
    }
    #[doc(alias = "f64x2.lt")]
    pub fn f64x2_lt(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i64, 2, as_f64x2, from_i64x2, <)
    }

    #[doc(alias = "f32x4.gt")]
    pub fn f32x4_gt(self, rhs: Self) -> Self {
        rhs.f32x4_lt(self)
    }

    #[doc(alias = "f64x2.gt")]
    pub fn f64x2_gt(self, rhs: Self) -> Self {
        rhs.f64x2_lt(self)
    }

    #[doc(alias = "f32x4.le")]
    pub fn f32x4_le(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i32, 4, as_f32x4, from_i32x4, <=)
    }
    #[doc(alias = "f64x2.le")]
    pub fn f64x2_le(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i64, 2, as_f64x2, from_i64x2, <=)
    }
    #[doc(alias = "f32x4.ge")]
    pub fn f32x4_ge(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i32, 4, as_f32x4, from_i32x4, >=)
    }
    #[doc(alias = "f64x2.ge")]
    pub fn f64x2_ge(self, rhs: Self) -> Self {
        simd_cmp_mask_const!(self, rhs, i64, 2, as_f64x2, from_i64x2, >=)
    }

    #[doc(alias = "f32x4.ceil")]
    pub fn f32x4_ceil(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| canonicalize_simd_f32_nan(x.ceil()))
    }
    #[doc(alias = "f64x2.ceil")]
    pub fn f64x2_ceil(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| canonicalize_simd_f64_nan(x.ceil()))
    }
    #[doc(alias = "f32x4.floor")]
    pub fn f32x4_floor(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| canonicalize_simd_f32_nan(x.floor()))
    }
    #[doc(alias = "f64x2.floor")]
    pub fn f64x2_floor(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| canonicalize_simd_f64_nan(x.floor()))
    }
    #[doc(alias = "f32x4.trunc")]
    pub fn f32x4_trunc(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| canonicalize_simd_f32_nan(x.trunc()))
    }
    #[doc(alias = "f64x2.trunc")]
    pub fn f64x2_trunc(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| canonicalize_simd_f64_nan(x.trunc()))
    }
    #[doc(alias = "f32x4.nearest")]
    pub fn f32x4_nearest(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| canonicalize_simd_f32_nan(TinywasmFloatExt::tw_nearest(x)))
    }
    #[doc(alias = "f64x2.nearest")]
    pub fn f64x2_nearest(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| canonicalize_simd_f64_nan(TinywasmFloatExt::tw_nearest(x)))
    }
    #[doc(alias = "f32x4.abs")]
    pub fn f32x4_abs(self) -> Self {
        simd_float_unary!(self, map_f32x4, f32::abs)
    }
    #[doc(alias = "f64x2.abs")]
    pub fn f64x2_abs(self) -> Self {
        simd_float_unary!(self, map_f64x2, f64::abs)
    }
    #[doc(alias = "f32x4.neg")]
    pub fn f32x4_neg(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| -x)
    }
    #[doc(alias = "f64x2.neg")]
    pub fn f64x2_neg(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| -x)
    }
    #[doc(alias = "f32x4.sqrt")]
    pub fn f32x4_sqrt(self) -> Self {
        simd_float_unary!(self, map_f32x4, |x| canonicalize_simd_f32_nan(x.sqrt()))
    }
    #[doc(alias = "f64x2.sqrt")]
    pub fn f64x2_sqrt(self) -> Self {
        simd_float_unary!(self, map_f64x2, |x| canonicalize_simd_f64_nan(x.sqrt()))
    }

    #[doc(alias = "f32x4.add")]
    pub fn f32x4_add(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| canonicalize_simd_f32_nan(a + b))
    }
    #[doc(alias = "f64x2.add")]
    pub fn f64x2_add(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| canonicalize_simd_f64_nan(a + b))
    }
    #[doc(alias = "f32x4.sub")]
    pub fn f32x4_sub(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| canonicalize_simd_f32_nan(a - b))
    }
    #[doc(alias = "f64x2.sub")]
    pub fn f64x2_sub(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| canonicalize_simd_f64_nan(a - b))
    }
    #[doc(alias = "f32x4.mul")]
    pub fn f32x4_mul(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| canonicalize_simd_f32_nan(a * b))
    }
    #[doc(alias = "f64x2.mul")]
    pub fn f64x2_mul(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| canonicalize_simd_f64_nan(a * b))
    }
    #[doc(alias = "f32x4.div")]
    pub fn f32x4_div(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| canonicalize_simd_f32_nan(a / b))
    }
    #[doc(alias = "f64x2.div")]
    pub fn f64x2_div(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| canonicalize_simd_f64_nan(a / b))
    }
    #[doc(alias = "f32x4.min")]
    pub fn f32x4_min(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, TinywasmFloatExt::tw_minimum)
    }
    #[doc(alias = "f64x2.min")]
    pub fn f64x2_min(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, TinywasmFloatExt::tw_minimum)
    }
    #[doc(alias = "f32x4.max")]
    pub fn f32x4_max(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, TinywasmFloatExt::tw_maximum)
    }
    #[doc(alias = "f64x2.max")]
    pub fn f64x2_max(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, TinywasmFloatExt::tw_maximum)
    }
    #[doc(alias = "f32x4.pmin")]
    pub fn f32x4_pmin(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| if b < a { b } else { a })
    }
    #[doc(alias = "f64x2.pmin")]
    pub fn f64x2_pmin(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| if b < a { b } else { a })
    }
    #[doc(alias = "f32x4.pmax")]
    pub fn f32x4_pmax(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f32x4, |a, b| if b > a { b } else { a })
    }
    #[doc(alias = "f64x2.pmax")]
    pub fn f64x2_pmax(self, rhs: Self) -> Self {
        simd_float_binary!(self, rhs, zip_f64x2, |a, b| if b > a { b } else { a })
    }

    #[doc(alias = "f32x4.relaxed_madd")]
    pub fn f32x4_relaxed_madd(self, b: Self, c: Self) -> Self {
        self.zip_f32x4(b, |x, y| canonicalize_simd_f32_nan(x * y))
            .zip_f32x4(c, |xy, z| canonicalize_simd_f32_nan(xy + z))
    }

    #[doc(alias = "f32x4.relaxed_nmadd")]
    pub fn f32x4_relaxed_nmadd(self, b: Self, c: Self) -> Self {
        self.zip_f32x4(b, |x, y| canonicalize_simd_f32_nan(-(x * y)))
            .zip_f32x4(c, |neg_xy, z| canonicalize_simd_f32_nan(neg_xy + z))
    }

    #[doc(alias = "f64x2.relaxed_madd")]
    pub fn f64x2_relaxed_madd(self, b: Self, c: Self) -> Self {
        self.zip_f64x2(b, |x, y| canonicalize_simd_f64_nan(x * y))
            .zip_f64x2(c, |xy, z| canonicalize_simd_f64_nan(xy + z))
    }

    #[doc(alias = "f64x2.relaxed_nmadd")]
    pub fn f64x2_relaxed_nmadd(self, b: Self, c: Self) -> Self {
        self.zip_f64x2(b, |x, y| canonicalize_simd_f64_nan(-(x * y)))
            .zip_f64x2(c, |neg_xy, z| canonicalize_simd_f64_nan(neg_xy + z))
    }

    #[doc(alias = "f32x4.relaxed_min")]
    pub fn f32x4_relaxed_min(self, rhs: Self) -> Self {
        self.f32x4_min(rhs)
    }

    #[doc(alias = "f64x2.relaxed_min")]
    pub fn f64x2_relaxed_min(self, rhs: Self) -> Self {
        self.f64x2_min(rhs)
    }

    #[doc(alias = "f32x4.relaxed_max")]
    pub fn f32x4_relaxed_max(self, rhs: Self) -> Self {
        self.f32x4_max(rhs)
    }

    #[doc(alias = "f64x2.relaxed_max")]
    pub fn f64x2_relaxed_max(self, rhs: Self) -> Self {
        self.f64x2_max(rhs)
    }

    #[doc(alias = "i32x4.relaxed_trunc_f32x4_s")]
    pub fn i32x4_relaxed_trunc_f32x4_s(self) -> Self {
        self.i32x4_trunc_sat_f32x4_s()
    }

    #[doc(alias = "i32x4.relaxed_trunc_f32x4_u")]
    pub fn i32x4_relaxed_trunc_f32x4_u(self) -> Self {
        self.i32x4_trunc_sat_f32x4_u()
    }

    #[doc(alias = "i32x4.relaxed_trunc_f64x2_s_zero")]
    pub fn i32x4_relaxed_trunc_f64x2_s_zero(self) -> Self {
        self.i32x4_trunc_sat_f64x2_s_zero()
    }

    #[doc(alias = "i32x4.relaxed_trunc_f64x2_u_zero")]
    pub fn i32x4_relaxed_trunc_f64x2_u_zero(self) -> Self {
        self.i32x4_trunc_sat_f64x2_u_zero()
    }

    #[doc(alias = "i32x4.trunc_sat_f32x4_s")]
    pub fn i32x4_trunc_sat_f32x4_s(self) -> Self {
        let v = self.as_f32x4();
        Self::from_i32x4([
            trunc_sat_f32_to_i32(v[0]),
            trunc_sat_f32_to_i32(v[1]),
            trunc_sat_f32_to_i32(v[2]),
            trunc_sat_f32_to_i32(v[3]),
        ])
    }

    #[doc(alias = "i32x4.trunc_sat_f32x4_u")]
    pub fn i32x4_trunc_sat_f32x4_u(self) -> Self {
        let v = self.as_f32x4();
        Self::from_u32x4([
            trunc_sat_f32_to_u32(v[0]),
            trunc_sat_f32_to_u32(v[1]),
            trunc_sat_f32_to_u32(v[2]),
            trunc_sat_f32_to_u32(v[3]),
        ])
    }

    #[doc(alias = "i32x4.trunc_sat_f64x2_s_zero")]
    pub fn i32x4_trunc_sat_f64x2_s_zero(self) -> Self {
        let v = self.as_f64x2();
        Self::from_i32x4([trunc_sat_f64_to_i32(v[0]), trunc_sat_f64_to_i32(v[1]), 0, 0])
    }

    #[doc(alias = "i32x4.trunc_sat_f64x2_u_zero")]
    pub fn i32x4_trunc_sat_f64x2_u_zero(self) -> Self {
        let v = self.as_f64x2();
        Self::from_u32x4([trunc_sat_f64_to_u32(v[0]), trunc_sat_f64_to_u32(v[1]), 0, 0])
    }

    #[doc(alias = "f32x4.convert_i32x4_s")]
    pub fn f32x4_convert_i32x4_s(self) -> Self {
        let v = self.as_i32x4();
        Self::from_f32x4([v[0] as f32, v[1] as f32, v[2] as f32, v[3] as f32])
    }

    #[doc(alias = "f32x4.convert_i32x4_u")]
    pub fn f32x4_convert_i32x4_u(self) -> Self {
        let v = self.as_u32x4();
        Self::from_f32x4([v[0] as f32, v[1] as f32, v[2] as f32, v[3] as f32])
    }

    #[doc(alias = "f64x2.convert_low_i32x4_s")]
    pub fn f64x2_convert_low_i32x4_s(self) -> Self {
        let v = self.as_i32x4();
        Self::from_f64x2([v[0] as f64, v[1] as f64])
    }

    #[doc(alias = "f64x2.convert_low_i32x4_u")]
    pub fn f64x2_convert_low_i32x4_u(self) -> Self {
        let v = self.as_u32x4();
        Self::from_f64x2([v[0] as f64, v[1] as f64])
    }

    #[doc(alias = "f32x4.demote_f64x2_zero")]
    pub fn f32x4_demote_f64x2_zero(self) -> Self {
        let v = self.as_f64x2();
        Self::from_f32x4([v[0] as f32, v[1] as f32, 0.0, 0.0])
    }

    #[doc(alias = "f64x2.promote_low_f32x4")]
    pub fn f64x2_promote_low_f32x4(self) -> Self {
        let v = self.as_f32x4();
        Self::from_f64x2([v[0] as f64, v[1] as f64])
    }

    #[doc(alias = "i16x8.splat")]
    pub fn splat_i16(src: i16) -> Self {
        Self::from_i16x8([src; 8])
    }

    #[doc(alias = "i32x4.splat")]
    pub fn splat_i32(src: i32) -> Self {
        Self::from_i32x4([src; 4])
    }

    #[doc(alias = "i64x2.splat")]
    pub fn splat_i64(src: i64) -> Self {
        Self::from_i64x2([src; 2])
    }

    #[doc(alias = "f32x4.splat")]
    pub fn splat_f32(src: f32) -> Self {
        Self::splat_i32(src.to_bits() as i32)
    }

    #[doc(alias = "f64x2.splat")]
    pub fn splat_f64(src: f64) -> Self {
        Self::splat_i64(src.to_bits() as i64)
    }

    #[doc(alias = "i8x16.extract_lane_s")]
    pub fn extract_lane_i8(self, lane: u8) -> i8 {
        debug_assert!(lane < 16);
        let lane = lane as usize;
        let bytes = self.0;
        bytes[lane] as i8
    }

    #[doc(alias = "i8x16.extract_lane_u")]
    pub fn extract_lane_u8(self, lane: u8) -> u8 {
        debug_assert!(lane < 16);
        let lane = lane as usize;
        let bytes = self.0;
        bytes[lane]
    }

    #[doc(alias = "i16x8.extract_lane_s")]
    pub fn extract_lane_i16(self, lane: u8) -> i16 {
        i16::from_le_bytes(self.extract_lane_bytes::<2>(lane, 8))
    }

    #[doc(alias = "i16x8.extract_lane_u")]
    pub fn extract_lane_u16(self, lane: u8) -> u16 {
        u16::from_le_bytes(self.extract_lane_bytes::<2>(lane, 8))
    }

    #[doc(alias = "i32x4.extract_lane")]
    pub fn extract_lane_i32(self, lane: u8) -> i32 {
        i32::from_le_bytes(self.extract_lane_bytes::<4>(lane, 4))
    }

    #[doc(alias = "i64x2.extract_lane")]
    pub fn extract_lane_i64(self, lane: u8) -> i64 {
        i64::from_le_bytes(self.extract_lane_bytes::<8>(lane, 2))
    }

    #[doc(alias = "f32x4.extract_lane")]
    pub fn extract_lane_f32(self, lane: u8) -> f32 {
        f32::from_bits(self.extract_lane_i32(lane) as u32)
    }

    #[doc(alias = "f64x2.extract_lane")]
    pub fn extract_lane_f64(self, lane: u8) -> f64 {
        f64::from_bits(self.extract_lane_i64(lane) as u64)
    }
}