@@ -676,9 +676,7 @@ module Memory = struct
676
676
let * l =
677
677
expression_list
678
678
(fun y ->
679
- if Code.Var. equal y deadcode_sentinal
680
- then return (W. Const (F64 0. ))
681
- else unbox_float (load y))
679
+ if Code.Var. equal y deadcode_sentinal then return (W. Const (F64 0. )) else load y)
682
680
l
683
681
in
684
682
let * ty = Type. float_array_type in
@@ -731,10 +729,9 @@ module Memory = struct
731
729
732
730
let array_set e e' e'' = wasm_array_set e Arith. (e' + const 1l ) e''
733
731
734
- let float_array_get e e' = box_float ( wasm_array_get ~ty: Type. float_array_type e e')
732
+ let float_array_get e e' = wasm_array_get ~ty: Type. float_array_type e e'
735
733
736
- let float_array_set e e' e'' =
737
- wasm_array_set ~ty: Type. float_array_type e e' (unbox_float e'')
734
+ let float_array_set e e' e'' = wasm_array_set ~ty: Type. float_array_type e e' e''
738
735
739
736
let gen_array_get e e' =
740
737
let a = Code.Var. fresh_n " a" in
@@ -1037,9 +1034,12 @@ module Constant = struct
1037
1034
let * e = Memory. make_int32 ~kind: `Nativeint (return (W. Const (I32 i))) in
1038
1035
return (Const , e)
1039
1036
1040
- let translate c =
1037
+ let translate ~ unboxed c =
1041
1038
match c with
1042
1039
| Code. Int i -> return (W. Const (I32 (Targetint. to_int32 i)))
1040
+ | Float f when unboxed -> return (W. Const (F64 (Int64. float_of_bits f)))
1041
+ | Int64 i when unboxed -> return (W. Const (I64 i))
1042
+ | (Int32 i | NativeInt i ) when unboxed -> return (W. Const (I32 i))
1043
1043
| _ -> (
1044
1044
let * const, c = translate_rec c in
1045
1045
match const with
0 commit comments