Skip to content

Commit 076c410

Browse files
committed
More refined type for caml_ldexp_float
1 parent 77b9bc7 commit 076c410

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/lib-wasm/generate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module Generate (Target : Target_sig.S) = struct
111111
; "caml_ba_uint8_set64", (`Mutator, [ Value; Int; Int64 ], Value)
112112
; "caml_nextafter_float", (`Pure, [ Float; Float ], Float)
113113
; "caml_classify_float", (`Pure, [ Float ], Value)
114-
; "caml_ldexp_float", (`Pure, [ Float; Value ], Float)
114+
; "caml_ldexp_float", (`Pure, [ Float; Int ], Float)
115115
; "caml_erf_float", (`Pure, [ Float ], Float)
116116
; "caml_erfc_float", (`Pure, [ Float ], Float)
117117
; "caml_float_compare", (`Pure, [ Float; Float ], Int)

runtime/wasm/float.wat

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@
717717
(array.new_fixed $block 3 (ref.i31 (i32.const 0))
718718
(struct.new $float (local.get $f)) (struct.new $float (local.get $i))))
719719

720-
(func $ldexp (param $x f64) (param $n i32) (result f64)
720+
(func $ldexp (export "caml_ldexp_float")
721+
(param $x f64) (param $n i32) (result f64)
721722
(if (i32.gt_s (local.get $n) (i32.const 1023))
722723
(then
723724
(local.set $x (f64.mul (local.get $x) (f64.const 0x1p1023)))
@@ -747,12 +748,6 @@
747748
(i64.const 0x3ff))
748749
(i64.const 52)))))
749750

750-
(func (export "caml_ldexp_float")
751-
(param $x f64) (param $i (ref eq)) (result f64)
752-
(call $ldexp
753-
(local.get $x)
754-
(i31.get_s (ref.cast (ref i31) (local.get $i)))))
755-
756751
(func $frexp (param $x f64) (result f64 i32)
757752
(local $y i64)
758753
(local $e i32)

0 commit comments

Comments
 (0)