Skip to content

Commit

Permalink
Wasm runtime: accurate float16 bigarrays when Float16Array is not ava…
Browse files Browse the repository at this point in the history
…ilable
  • Loading branch information
vouillon committed Jan 21, 2025
1 parent 18a66e2 commit 3e9b343
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions runtime/wasm/bigarray.wat
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,10 @@
(struct.get $bigarray $ba_kind (local.get $ba))))
;; float16
(call $ta_set_f16 (local.get $data) (local.get $i)
(struct.get $float 0
(ref.cast (ref $float) (local.get $v))))
(call $float16_to_double
(call $double_to_float16
(struct.get $float 0
(ref.cast (ref $float) (local.get $v))))))
(return))
;; complex64
(local.set $i (i32.shl (local.get $i) (i32.const 1)))
Expand Down
1 change: 0 additions & 1 deletion tools/node_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ let extra_args_for_wasoo =
[ "--experimental-wasm-imported-strings"
; "--experimental-wasm-stack-switching"
; "--stack-size=10000"
; "--js-float16array"
]

let env = Unix.environment ()
Expand Down

0 comments on commit 3e9b343

Please sign in to comment.