Skip to content

Commit 7a64c62

Browse files
committed
rework
1 parent 4069311 commit 7a64c62

File tree

8 files changed

+448
-37
lines changed

8 files changed

+448
-37
lines changed

src/literal.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ let float32 n = float32_bits @@ Int32.bits_of_float n
1010
external float64 : float -> t = "caml_binaryen_literal_float64"
1111
external vec128 : int array -> t = "caml_binaryen_literal_vec128"
1212

13-
let vec128 (low, high) =
13+
let vec128 (low, low_mid, high_mid, high) =
1414
let bytes = Bytes.create 16 in
15-
Bytes.set_int64_le bytes 0 low;
16-
Bytes.set_int64_le bytes 8 high;
15+
Bytes.set_int32_le bytes 0 low;
16+
Bytes.set_int32_le bytes 4 low_mid;
17+
Bytes.set_int32_le bytes 8 high_mid;
18+
Bytes.set_int32_le bytes 12 high;
1719
let arr = Array.init 16 (Bytes.get_uint8 bytes) in
1820
vec128 arr

src/literal.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ val float32_bits : int32 -> t
66
val float64_bits : int64 -> t
77
val float32 : float -> t
88
val float64 : float -> t
9-
val vec128 : int64 * int64 -> t
9+
val vec128 : int32 * int32 * int32 * int32 -> t

src/op.c

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,48 @@ caml_binaryen_ge_u_vec_i32x4(value unit) {
13501350
CAMLreturn(alloc_BinaryenOp(op));
13511351
}
13521352

1353+
CAMLprim value
1354+
caml_binaryen_eq_vec_i64x2(value unit) {
1355+
CAMLparam1(unit);
1356+
BinaryenOp op = BinaryenEqVecI64x2();
1357+
CAMLreturn(alloc_BinaryenOp(op));
1358+
}
1359+
1360+
CAMLprim value
1361+
caml_binaryen_ne_vec_i64x2(value unit) {
1362+
CAMLparam1(unit);
1363+
BinaryenOp op = BinaryenNeVecI64x2();
1364+
CAMLreturn(alloc_BinaryenOp(op));
1365+
}
1366+
1367+
CAMLprim value
1368+
caml_binaryen_lt_s_vec_i64x2(value unit) {
1369+
CAMLparam1(unit);
1370+
BinaryenOp op = BinaryenLtSVecI64x2();
1371+
CAMLreturn(alloc_BinaryenOp(op));
1372+
}
1373+
1374+
CAMLprim value
1375+
caml_binaryen_gt_s_vec_i64x2(value unit) {
1376+
CAMLparam1(unit);
1377+
BinaryenOp op = BinaryenGtSVecI64x2();
1378+
CAMLreturn(alloc_BinaryenOp(op));
1379+
}
1380+
1381+
CAMLprim value
1382+
caml_binaryen_le_s_vec_i64x2(value unit) {
1383+
CAMLparam1(unit);
1384+
BinaryenOp op = BinaryenLeSVecI64x2();
1385+
CAMLreturn(alloc_BinaryenOp(op));
1386+
}
1387+
1388+
CAMLprim value
1389+
caml_binaryen_ge_s_vec_i64x2(value unit) {
1390+
CAMLparam1(unit);
1391+
BinaryenOp op = BinaryenGeSVecI64x2();
1392+
CAMLreturn(alloc_BinaryenOp(op));
1393+
}
1394+
13531395
CAMLprim value
13541396
caml_binaryen_eq_vec_f32x4(value unit) {
13551397
CAMLparam1(unit);
@@ -1812,6 +1854,41 @@ caml_binaryen_avgr_u_vec_i16x8(value unit) {
18121854
CAMLreturn(alloc_BinaryenOp(op));
18131855
}
18141856

1857+
CAMLprim value
1858+
caml_binaryen_q15_mulr_sat_s_vec_i16x8(value unit) {
1859+
CAMLparam1(unit);
1860+
BinaryenOp op = BinaryenQ15MulrSatSVecI16x8();
1861+
CAMLreturn(alloc_BinaryenOp(op));
1862+
}
1863+
1864+
CAMLprim value
1865+
caml_binaryen_ext_mul_low_s_vec_i16x8(value unit) {
1866+
CAMLparam1(unit);
1867+
BinaryenOp op = BinaryenExtMulLowSVecI16x8();
1868+
CAMLreturn(alloc_BinaryenOp(op));
1869+
}
1870+
1871+
CAMLprim value
1872+
caml_binaryen_ext_mul_high_s_vec_i16x8(value unit) {
1873+
CAMLparam1(unit);
1874+
BinaryenOp op = BinaryenExtMulHighSVecI16x8();
1875+
CAMLreturn(alloc_BinaryenOp(op));
1876+
}
1877+
1878+
CAMLprim value
1879+
caml_binaryen_ext_mul_low_u_vec_i16x8(value unit) {
1880+
CAMLparam1(unit);
1881+
BinaryenOp op = BinaryenExtMulLowUVecI16x8();
1882+
CAMLreturn(alloc_BinaryenOp(op));
1883+
}
1884+
1885+
CAMLprim value
1886+
caml_binaryen_ext_mul_high_u_vec_i16x8(value unit) {
1887+
CAMLparam1(unit);
1888+
BinaryenOp op = BinaryenExtMulHighUVecI16x8();
1889+
CAMLreturn(alloc_BinaryenOp(op));
1890+
}
1891+
18151892
CAMLprim value
18161893
caml_binaryen_abs_vec_i32x4(value unit) {
18171894
CAMLparam1(unit);
@@ -1917,13 +1994,62 @@ caml_binaryen_dot_s_vec_i16x8_to_vec_i32x4(value unit) {
19171994
CAMLreturn(alloc_BinaryenOp(op));
19181995
}
19191996

1997+
CAMLprim value
1998+
caml_binaryen_ext_mul_low_s_vec_i32x4(value unit) {
1999+
CAMLparam1(unit);
2000+
BinaryenOp op = BinaryenExtMulLowSVecI32x4();
2001+
CAMLreturn(alloc_BinaryenOp(op));
2002+
}
2003+
2004+
CAMLprim value
2005+
caml_binaryen_ext_mul_high_s_vec_i32x4(value unit) {
2006+
CAMLparam1(unit);
2007+
BinaryenOp op = BinaryenExtMulHighSVecI32x4();
2008+
CAMLreturn(alloc_BinaryenOp(op));
2009+
}
2010+
2011+
CAMLprim value
2012+
caml_binaryen_ext_mul_low_u_vec_i32x4(value unit) {
2013+
CAMLparam1(unit);
2014+
BinaryenOp op = BinaryenExtMulLowUVecI32x4();
2015+
CAMLreturn(alloc_BinaryenOp(op));
2016+
}
2017+
2018+
CAMLprim value
2019+
caml_binaryen_ext_mul_high_u_vec_i32x4(value unit) {
2020+
CAMLparam1(unit);
2021+
BinaryenOp op = BinaryenExtMulHighUVecI32x4();
2022+
CAMLreturn(alloc_BinaryenOp(op));
2023+
}
2024+
2025+
CAMLprim value
2026+
caml_binaryen_abs_vec_i64x2(value unit) {
2027+
CAMLparam1(unit);
2028+
BinaryenOp op = BinaryenAbsVecI64x2();
2029+
CAMLreturn(alloc_BinaryenOp(op));
2030+
}
2031+
19202032
CAMLprim value
19212033
caml_binaryen_neg_vec_i64x2(value unit) {
19222034
CAMLparam1(unit);
19232035
BinaryenOp op = BinaryenNegVecI64x2();
19242036
CAMLreturn(alloc_BinaryenOp(op));
19252037
}
19262038

2039+
CAMLprim value
2040+
caml_binaryen_all_true_vec_i64x2(value unit) {
2041+
CAMLparam1(unit);
2042+
BinaryenOp op = BinaryenAllTrueVecI64x2();
2043+
CAMLreturn(alloc_BinaryenOp(op));
2044+
}
2045+
2046+
CAMLprim value
2047+
caml_binaryen_bitmask_vec_i64x2(value unit) {
2048+
CAMLparam1(unit);
2049+
BinaryenOp op = BinaryenBitmaskVecI64x2();
2050+
CAMLreturn(alloc_BinaryenOp(op));
2051+
}
2052+
19272053
CAMLprim value
19282054
caml_binaryen_shl_vec_i64x2(value unit) {
19292055
CAMLparam1(unit);
@@ -1966,6 +2092,34 @@ caml_binaryen_mul_vec_i64x2(value unit) {
19662092
CAMLreturn(alloc_BinaryenOp(op));
19672093
}
19682094

2095+
CAMLprim value
2096+
caml_binaryen_ext_mul_low_s_vec_i64x2(value unit) {
2097+
CAMLparam1(unit);
2098+
BinaryenOp op = BinaryenExtMulLowSVecI64x2();
2099+
CAMLreturn(alloc_BinaryenOp(op));
2100+
}
2101+
2102+
CAMLprim value
2103+
caml_binaryen_ext_mul_high_s_vec_i64x2(value unit) {
2104+
CAMLparam1(unit);
2105+
BinaryenOp op = BinaryenExtMulHighSVecI64x2();
2106+
CAMLreturn(alloc_BinaryenOp(op));
2107+
}
2108+
2109+
CAMLprim value
2110+
caml_binaryen_ext_mul_low_u_vec_i64x2(value unit) {
2111+
CAMLparam1(unit);
2112+
BinaryenOp op = BinaryenExtMulLowUVecI64x2();
2113+
CAMLreturn(alloc_BinaryenOp(op));
2114+
}
2115+
2116+
CAMLprim value
2117+
caml_binaryen_ext_mul_high_u_vec_i64x2(value unit) {
2118+
CAMLparam1(unit);
2119+
BinaryenOp op = BinaryenExtMulHighUVecI64x2();
2120+
CAMLreturn(alloc_BinaryenOp(op));
2121+
}
2122+
19692123
CAMLprim value
19702124
caml_binaryen_abs_vec_f32x4(value unit) {
19712125
CAMLparam1(unit);

src/op.js

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,42 @@ function caml_binaryen_ge_u_vec_i32x4() {
11501150
return Binaryen.Operations.GeUVecI32x4;
11511151
}
11521152

1153+
//Provides: caml_binaryen_eq_vec_i64x2
1154+
//Requires: Binaryen
1155+
function caml_binaryen_eq_vec_i64x2() {
1156+
return Binaryen.Operations.EqVecI64x2;
1157+
}
1158+
1159+
//Provides: caml_binaryen_ne_vec_i64x2
1160+
//Requires: Binaryen
1161+
function caml_binaryen_ne_vec_i64x2() {
1162+
return Binaryen.Operations.NeVecI64x2;
1163+
}
1164+
1165+
//Provides: caml_binaryen_lt_s_vec_i64x2
1166+
//Requires: Binaryen
1167+
function caml_binaryen_lt_s_vec_i64x2() {
1168+
return Binaryen.Operations.LtSVecI64x2;
1169+
}
1170+
1171+
//Provides: caml_binaryen_gt_s_vec_i64x2
1172+
//Requires: Binaryen
1173+
function caml_binaryen_gt_s_vec_i64x2() {
1174+
return Binaryen.Operations.GtSVecI64x2;
1175+
}
1176+
1177+
//Provides: caml_binaryen_le_s_vec_i64x2
1178+
//Requires: Binaryen
1179+
function caml_binaryen_le_s_vec_i64x2() {
1180+
return Binaryen.Operations.LeSVecI64x2;
1181+
}
1182+
1183+
//Provides: caml_binaryen_ge_s_vec_i64x2
1184+
//Requires: Binaryen
1185+
function caml_binaryen_ge_s_vec_i64x2() {
1186+
return Binaryen.Operations.GeSVecI64x2;
1187+
}
1188+
11531189
//Provides: caml_binaryen_eq_vec_f32x4
11541190
//Requires: Binaryen
11551191
function caml_binaryen_eq_vec_f32x4() {
@@ -1546,6 +1582,36 @@ function caml_binaryen_avgr_u_vec_i16x8() {
15461582
return Binaryen.Operations.AvgrUVecI16x8;
15471583
}
15481584

1585+
//Provides: caml_binaryen_q15_mulr_sat_s_vec_i16x8
1586+
//Requires: Binaryen
1587+
function caml_binaryen_q15_mulr_sat_s_vec_i16x8() {
1588+
return Binaryen.Operations.Q15MulrSatSVecI16x8;
1589+
}
1590+
1591+
//Provides: caml_binaryen_ext_mul_low_s_vec_i16x8
1592+
//Requires: Binaryen
1593+
function caml_binaryen_ext_mul_low_s_vec_i16x8() {
1594+
return Binaryen.Operations.ExtMulLowSVecI16x8;
1595+
}
1596+
1597+
//Provides: caml_binaryen_ext_mul_high_s_vec_i16x8
1598+
//Requires: Binaryen
1599+
function caml_binaryen_ext_mul_high_s_vec_i16x8() {
1600+
return Binaryen.Operations.ExtMulHighSVecI16x8;
1601+
}
1602+
1603+
//Provides: caml_binaryen_ext_mul_low_u_vec_i16x8
1604+
//Requires: Binaryen
1605+
function caml_binaryen_ext_mul_low_u_vec_i16x8() {
1606+
return Binaryen.Operations.ExtMulLowUVecI16x8;
1607+
}
1608+
1609+
//Provides: caml_binaryen_ext_mul_high_u_vec_i16x8
1610+
//Requires: Binaryen
1611+
function caml_binaryen_ext_mul_high_u_vec_i16x8() {
1612+
return Binaryen.Operations.ExtMulHighUVecI16x8;
1613+
}
1614+
15491615
//Provides: caml_binaryen_abs_vec_i32x4
15501616
//Requires: Binaryen
15511617
function caml_binaryen_abs_vec_i32x4() {
@@ -1636,12 +1702,54 @@ function caml_binaryen_dot_s_vec_i16x8_to_vec_i32x4() {
16361702
return Binaryen.Operations.DotSVecI16x8ToVecI32x4;
16371703
}
16381704

1705+
//Provides: caml_binaryen_ext_mul_low_s_vec_i32x4
1706+
//Requires: Binaryen
1707+
function caml_binaryen_ext_mul_low_s_vec_i32x4() {
1708+
return Binaryen.Operations.ExtMulLowSVecI32x4;
1709+
}
1710+
1711+
//Provides: caml_binaryen_ext_mul_high_s_vec_i32x4
1712+
//Requires: Binaryen
1713+
function caml_binaryen_ext_mul_high_s_vec_i32x4() {
1714+
return Binaryen.Operations.ExtMulHighSVecI32x4;
1715+
}
1716+
1717+
//Provides: caml_binaryen_ext_mul_low_u_vec_i32x4
1718+
//Requires: Binaryen
1719+
function caml_binaryen_ext_mul_low_u_vec_i32x4() {
1720+
return Binaryen.Operations.ExtMulLowUVecI32x4;
1721+
}
1722+
1723+
//Provides: caml_binaryen_ext_mul_high_u_vec_i32x4
1724+
//Requires: Binaryen
1725+
function caml_binaryen_ext_mul_high_u_vec_i32x4() {
1726+
return Binaryen.Operations.ExtMulHighUVecI32x4;
1727+
}
1728+
1729+
//Provides: caml_binaryen_abs_vec_i64x2
1730+
//Requires: Binaryen
1731+
function caml_binaryen_abs_vec_i64x2() {
1732+
return Binaryen.Operations.AbsVecI64x2;
1733+
}
1734+
16391735
//Provides: caml_binaryen_neg_vec_i64x2
16401736
//Requires: Binaryen
16411737
function caml_binaryen_neg_vec_i64x2() {
16421738
return Binaryen.Operations.NegVecI64x2;
16431739
}
16441740

1741+
//Provides: caml_binaryen_all_true_vec_i64x2
1742+
//Requires: Binaryen
1743+
function caml_binaryen_all_true_vec_i64x2() {
1744+
return Binaryen.Operations.AllTrueVecI64x2;
1745+
}
1746+
1747+
//Provides: caml_binaryen_bitmask_vec_i64x2
1748+
//Requires: Binaryen
1749+
function caml_binaryen_bitmask_vec_i64x2() {
1750+
return Binaryen.Operations.BitmaskVecI64x2;
1751+
}
1752+
16451753
//Provides: caml_binaryen_shl_vec_i64x2
16461754
//Requires: Binaryen
16471755
function caml_binaryen_shl_vec_i64x2() {
@@ -1678,6 +1786,30 @@ function caml_binaryen_mul_vec_i64x2() {
16781786
return Binaryen.Operations.MulVecI64x2;
16791787
}
16801788

1789+
//Provides: caml_binaryen_ext_mul_low_s_vec_i64x2
1790+
//Requires: Binaryen
1791+
function caml_binaryen_ext_mul_low_s_vec_i64x2() {
1792+
return Binaryen.Operations.ExtMulLowSVecI64x2;
1793+
}
1794+
1795+
//Provides: caml_binaryen_ext_mul_high_s_vec_i64x2
1796+
//Requires: Binaryen
1797+
function caml_binaryen_ext_mul_high_s_vec_i64x2() {
1798+
return Binaryen.Operations.ExtMulHighSVecI64x2;
1799+
}
1800+
1801+
//Provides: caml_binaryen_ext_mul_low_u_vec_i64x2
1802+
//Requires: Binaryen
1803+
function caml_binaryen_ext_mul_low_u_vec_i64x2() {
1804+
return Binaryen.Operations.ExtMulLowUVecI64x2;
1805+
}
1806+
1807+
//Provides: caml_binaryen_ext_mul_high_u_vec_i64x2
1808+
//Requires: Binaryen
1809+
function caml_binaryen_ext_mul_high_u_vec_i64x2() {
1810+
return Binaryen.Operations.ExtMulHighUVecI64x2;
1811+
}
1812+
16811813
//Provides: caml_binaryen_abs_vec_f32x4
16821814
//Requires: Binaryen
16831815
function caml_binaryen_abs_vec_f32x4() {

0 commit comments

Comments
 (0)