Skip to content

Commit

Permalink
Runtime: rename some internal hash functions for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Mar 6, 2024
1 parent 6320915 commit 5741b98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions runtime/wasm/bigarray.wat
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
(func $caml_hash_mix_int (param i32) (param i32) (result i32)))
(import "hash" "caml_hash_mix_int64"
(func $caml_hash_mix_int64 (param i32) (param i64) (result i32)))
(import "hash" "caml_hash_mix_double"
(func $caml_hash_mix_double (param i32) (param f64) (result i32)))
(import "hash" "caml_hash_mix_float"
(func $caml_hash_mix_float (param i32) (param f64) (result i32)))
(import "hash" "caml_hash_mix_float32"
(func $caml_hash_mix_float32 (param i32) (param f32) (result i32)))
(func $caml_hash_mix_float (param i32) (param f32) (result i32)))
(import "marshal" "caml_serialize_int_1"
(func $caml_serialize_int_1 (param (ref eq)) (param i32)))
(import "marshal" "caml_serialize_int_2"
Expand Down Expand Up @@ -342,7 +342,7 @@
(if (i32.lt_u (local.get $i) (local.get $len))
(then
(local.set $h
(call $caml_hash_mix_float32 (local.get $h)
(call $caml_hash_mix_float (local.get $h)
(f32.demote_f64
(call $ta_get_f32 (local.get $data) (local.get $i)))))
(local.set $i (i32.add (local.get $i) (i32.const 1)))
Expand All @@ -355,7 +355,7 @@
(if (i32.lt_u (local.get $i) (local.get $len))
(then
(local.set $h
(call $caml_hash_mix_float (local.get $h)
(call $caml_hash_mix_double (local.get $h)
(call $ta_get_f64 (local.get $data) (local.get $i))))
(local.set $i (i32.add (local.get $i) (i32.const 1)))
(br $loop))))
Expand Down
6 changes: 3 additions & 3 deletions runtime/wasm/hash.wat
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
(call $caml_hash_mix_int (local.get $h) (i32.wrap_i64 (local.get $d)))
(i32.wrap_i64 (i64.shr_u (local.get $d) (i64.const 32)))))

(func $caml_hash_mix_float (export "caml_hash_mix_float")
(func $caml_hash_mix_double (export "caml_hash_mix_double")
(param $h i32) (param $d f64) (result i32)
(local $i i64)
(local.set $i (i64.reinterpret_f64 (local.get $d)))
Expand All @@ -78,7 +78,7 @@
(then (local.set $i (i64.const 0))))
(return_call $caml_hash_mix_int64 (local.get $h) (local.get $i)))

(func $caml_hash_mix_float32 (export "caml_hash_mix_float32")
(func $caml_hash_mix_float (export "caml_hash_mix_float")
(param $h i32) (param $d f32) (result i32)
(local $i i32)
(local.set $i (i32.reinterpret_f32 (local.get $d)))
Expand Down Expand Up @@ -257,7 +257,7 @@
(br $block_iter))))
(drop (block $not_float (result (ref eq))
(local.set $h
(call $caml_hash_mix_float (local.get $h)
(call $caml_hash_mix_double (local.get $h)
(struct.get $float 0
(br_on_cast_fail $not_float (ref eq) (ref $float)
(local.get $v)))))
Expand Down

0 comments on commit 5741b98

Please sign in to comment.