|
44 | 44 | (import "bindings" "ta_subarray" |
45 | 45 | (func $ta_subarray |
46 | 46 | (param (ref extern)) (param i32) (param i32) (result (ref extern)))) |
47 | | - (import "fail" "caml_bound_error" (func $caml_bound_error)) |
| 47 | + (import "fail" "caml_bound_error" (func $caml_bound_error (result (ref eq)))) |
48 | 48 | (import "fail" "caml_raise_out_of_memory" (func $caml_raise_out_of_memory)) |
49 | 49 | (import "fail" "caml_invalid_argument" |
50 | 50 | (func $caml_invalid_argument (param (ref eq)))) |
|
953 | 953 | (if (i32.ge_u (local.get $i) |
954 | 954 | (array.get $int_array (struct.get $bigarray 2 (local.get $ba)) |
955 | 955 | (i32.const 0))) |
956 | | - (then (call $caml_bound_error))) |
| 956 | + (then (return_call $caml_bound_error))) |
957 | 957 | (return_call $caml_ba_get_at_offset (local.get $ba) (local.get $i))) |
958 | 958 |
|
959 | 959 | (func (export "caml_ba_set_1") |
|
967 | 967 | (if (i32.ge_u (local.get $i) |
968 | 968 | (array.get $int_array (struct.get $bigarray $ba_dim (local.get $ba)) |
969 | 969 | (i32.const 0))) |
970 | | - (then (call $caml_bound_error))) |
| 970 | + (then (return_call $caml_bound_error))) |
971 | 971 | (call $caml_ba_set_at_offset |
972 | 972 | (local.get $ba) (local.get $i) (local.get $v)) |
973 | 973 | (ref.i31 (i32.const 0))) |
|
1005 | 1005 | (i32.ge_u (local.get $j) |
1006 | 1006 | (array.get $int_array (local.get $dim) (i32.const 1)))) |
1007 | 1007 | (then |
1008 | | - (call $caml_bound_error))) |
| 1008 | + (return_call $caml_bound_error))) |
1009 | 1009 | (return_call $caml_ba_get_at_offset (local.get $ba) (local.get $offset))) |
1010 | 1010 |
|
1011 | 1011 | (func (export "caml_ba_set_2") |
|
1041 | 1041 | (i32.ge_u (local.get $j) |
1042 | 1042 | (array.get $int_array (local.get $dim) (i32.const 1)))) |
1043 | 1043 | (then |
1044 | | - (call $caml_bound_error))) |
| 1044 | + (return_call $caml_bound_error))) |
1045 | 1045 | (call $caml_ba_set_at_offset |
1046 | 1046 | (local.get $ba) (local.get $offset) (local.get $v)) |
1047 | 1047 | (ref.i31 (i32.const 0))) |
|
1099 | 1099 | (i32.ge_u (local.get $j) |
1100 | 1100 | (array.get $int_array (local.get $dim) (i32.const 2))))) |
1101 | 1101 | (then |
1102 | | - (call $caml_bound_error))) |
| 1102 | + (return_call $caml_bound_error))) |
1103 | 1103 | (return_call $caml_ba_get_at_offset (local.get $ba) (local.get $offset))) |
1104 | 1104 |
|
1105 | 1105 | (func (export "caml_ba_set_3") |
|
1152 | 1152 | (i32.ge_u (local.get $k) |
1153 | 1153 | (array.get $int_array (local.get $dim) (i32.const 2))))) |
1154 | 1154 | (then |
1155 | | - (call $caml_bound_error))) |
| 1155 | + (return_call $caml_bound_error))) |
1156 | 1156 | (call $caml_ba_set_at_offset |
1157 | 1157 | (local.get $ba) (local.get $offset) (local.get $v)) |
1158 | 1158 | (ref.i31 (i32.const 0))) |
|
1183 | 1183 | (array.get $int_array (local.get $dim) (local.get $i))) |
1184 | 1184 | (if (i32.ge_u (local.get $idx) (local.get $l)) |
1185 | 1185 | (then |
1186 | | - (call $caml_bound_error))) |
| 1186 | + (drop (call $caml_bound_error)))) |
1187 | 1187 | (local.set $offset |
1188 | 1188 | (i32.add (i32.mul (local.get $offset) (local.get $l)) |
1189 | 1189 | (local.get $idx))) |
|
1201 | 1201 | (array.get $int_array (local.get $dim) (local.get $i))) |
1202 | 1202 | (if (i32.ge_u (local.get $idx) (local.get $l)) |
1203 | 1203 | (then |
1204 | | - (call $caml_bound_error))) |
| 1204 | + (drop (call $caml_bound_error)))) |
1205 | 1205 | (local.set $offset |
1206 | 1206 | (i32.add (i32.mul (local.get $offset) (local.get $l)) |
1207 | 1207 | (local.get $idx))) |
|
1234 | 1234 | (array.get $int_array (local.get $dim) (local.get $i))) |
1235 | 1235 | (if (i32.ge_u (local.get $idx) (local.get $l)) |
1236 | 1236 | (then |
1237 | | - (call $caml_bound_error))) |
| 1237 | + (drop (call $caml_bound_error)))) |
1238 | 1238 | (local.set $offset |
1239 | 1239 | (i32.add (i32.mul (local.get $offset) (local.get $l)) |
1240 | 1240 | (local.get $idx))) |
|
1255 | 1255 | (array.get $int_array (local.get $dim) (local.get $i))) |
1256 | 1256 | (if (i32.ge_u (local.get $idx) (local.get $l)) |
1257 | 1257 | (then |
1258 | | - (call $caml_bound_error))) |
| 1258 | + (drop (call $caml_bound_error)))) |
1259 | 1259 | (local.set $offset |
1260 | 1260 | (i32.add (i32.mul (local.get $offset) (local.get $l)) |
1261 | 1261 | (local.get $idx))) |
|
1889 | 1889 | (local.set $data (struct.get $bigarray $ba_data (local.get $ba))) |
1890 | 1890 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
1891 | 1891 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
1892 | | - (then (call $caml_bound_error))) |
| 1892 | + (then (return_call $caml_bound_error))) |
1893 | 1893 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 1)) |
1894 | 1894 | (array.get $int_array |
1895 | 1895 | (struct.get $bigarray $ba_dim (local.get $ba)) |
1896 | 1896 | (i32.const 0))) |
1897 | | - (then (call $caml_bound_error))) |
| 1897 | + (then (return_call $caml_bound_error))) |
1898 | 1898 | (ref.i31 (i32.or |
1899 | 1899 | (call $ta_get_ui8 (local.get $data) (local.get $p)) |
1900 | 1900 | (i32.shl (call $ta_get_ui8 (local.get $data) |
|
1910 | 1910 | (local.set $data (struct.get $bigarray $ba_data (local.get $ba))) |
1911 | 1911 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
1912 | 1912 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
1913 | | - (then (call $caml_bound_error))) |
| 1913 | + (then (return_call $caml_bound_error))) |
1914 | 1914 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 3)) |
1915 | 1915 | (array.get $int_array |
1916 | 1916 | (struct.get $bigarray $ba_dim (local.get $ba)) |
1917 | 1917 | (i32.const 0))) |
1918 | | - (then (call $caml_bound_error))) |
| 1918 | + (then (return_call $caml_bound_error))) |
1919 | 1919 | (return_call $caml_copy_int32 |
1920 | 1920 | (i32.or |
1921 | 1921 | (i32.or |
|
1940 | 1940 | (local.set $data (struct.get $bigarray $ba_data (local.get $ba))) |
1941 | 1941 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
1942 | 1942 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
1943 | | - (then (call $caml_bound_error))) |
| 1943 | + (then (return_call $caml_bound_error))) |
1944 | 1944 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 7)) |
1945 | 1945 | (array.get $int_array |
1946 | 1946 | (struct.get $bigarray $ba_dim (local.get $ba)) |
1947 | 1947 | (i32.const 0))) |
1948 | | - (then (call $caml_bound_error))) |
| 1948 | + (then (return_call $caml_bound_error))) |
1949 | 1949 | (return_call $caml_copy_int64 |
1950 | 1950 | (i64.or |
1951 | 1951 | (i64.or |
|
1996 | 1996 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
1997 | 1997 | (local.set $d (ref.cast (ref i31) (local.get $v))) |
1998 | 1998 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
1999 | | - (then (call $caml_bound_error))) |
| 1999 | + (then (return_call $caml_bound_error))) |
2000 | 2000 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 1)) |
2001 | 2001 | (array.get $int_array |
2002 | 2002 | (struct.get $bigarray $ba_dim (local.get $ba)) |
2003 | 2003 | (i32.const 0))) |
2004 | | - (then (call $caml_bound_error))) |
| 2004 | + (then (return_call $caml_bound_error))) |
2005 | 2005 | (call $ta_set_ui8 (local.get $data) (local.get $p) (local.get $d)) |
2006 | 2006 | (call $ta_set_ui8 (local.get $data) |
2007 | 2007 | (i32.add (local.get $p) (i32.const 1)) |
|
2019 | 2019 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
2020 | 2020 | (local.set $d (call $Int32_val (local.get $v))) |
2021 | 2021 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
2022 | | - (then (call $caml_bound_error))) |
| 2022 | + (then (return_call $caml_bound_error))) |
2023 | 2023 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 3)) |
2024 | 2024 | (array.get $int_array |
2025 | 2025 | (struct.get $bigarray $ba_dim (local.get $ba)) |
2026 | 2026 | (i32.const 0))) |
2027 | | - (then (call $caml_bound_error))) |
| 2027 | + (then (return_call $caml_bound_error))) |
2028 | 2028 | (call $ta_set_ui8 (local.get $data) (local.get $p) |
2029 | 2029 | (ref.i31 (local.get $d))) |
2030 | 2030 | (call $ta_set_ui8 (local.get $data) |
|
2049 | 2049 | (local.set $p (i31.get_s (ref.cast (ref i31) (local.get $i)))) |
2050 | 2050 | (local.set $d (call $Int64_val (local.get $v))) |
2051 | 2051 | (if (i32.lt_s (local.get $p) (i32.const 0)) |
2052 | | - (then (call $caml_bound_error))) |
| 2052 | + (then (return_call $caml_bound_error))) |
2053 | 2053 | (if (i32.ge_u (i32.add (local.get $p) (i32.const 7)) |
2054 | 2054 | (array.get $int_array |
2055 | 2055 | (struct.get $bigarray $ba_dim (local.get $ba)) |
2056 | 2056 | (i32.const 0))) |
2057 | | - (then (call $caml_bound_error))) |
| 2057 | + (then (return_call $caml_bound_error))) |
2058 | 2058 | (call $ta_set_ui8 (local.get $data) (local.get $p) |
2059 | 2059 | (ref.i31 (i32.wrap_i64 (local.get $d)))) |
2060 | 2060 | (call $ta_set_ui8 (local.get $data) |
|
0 commit comments