2018-05-08 00:36:19 +02:00
|
|
|
(module
|
|
|
|
(type $ii (func (param i32) (result i32)))
|
2018-05-11 16:31:56 +02:00
|
|
|
(type $Ii (func (param i64) (result i32)))
|
2019-02-07 15:26:26 +01:00
|
|
|
(type $_ (func))
|
2018-10-11 08:49:08 +02:00
|
|
|
(memory $0 1)
|
|
|
|
(data (i32.const 8) "\00\00\00\00")
|
|
|
|
(data (i32.const 16) "\01\00\00\00a\00")
|
|
|
|
(data (i32.const 24) "\02\00\00\00a\00b\00")
|
|
|
|
(data (i32.const 32) "\03\00\00\00a\00b\00c\00")
|
2019-02-05 17:12:10 +01:00
|
|
|
(table $0 1 funcref)
|
2018-10-11 08:49:08 +02:00
|
|
|
(elem (i32.const 0) $null)
|
2019-02-21 00:11:22 +01:00
|
|
|
(global $~lib/memory/HEAP_BASE i32 (i32.const 44))
|
2018-05-08 00:36:19 +02:00
|
|
|
(export "memory" (memory $0))
|
2018-10-11 08:49:08 +02:00
|
|
|
(export "table" (table $0))
|
2018-05-08 00:36:19 +02:00
|
|
|
(start $start)
|
2018-06-28 01:44:32 +02:00
|
|
|
(func $~lib/internal/hash/hashStr (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $1 i32)
|
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const -2128831035
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
2018-11-08 08:04:24 +01:00
|
|
|
block $break|0
|
|
|
|
block
|
|
|
|
i32.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.load
|
|
|
|
i32.const 1
|
|
|
|
i32.shl
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
loop $repeat|0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $2
|
|
|
|
local.get $3
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_u
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
|
|
|
local.get $0
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.load8_u offset=4
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|0
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2018-06-28 01:44:32 +02:00
|
|
|
(func $std/hash/check (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
2018-06-28 01:44:32 +02:00
|
|
|
)
|
2018-05-11 16:31:56 +02:00
|
|
|
(func $~lib/internal/hash/hash32 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $1 i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const -2128831035
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2018-05-11 16:31:56 +02:00
|
|
|
(func $~lib/internal/hash/hash64 (; 3 ;) (type $Ii) (param $0 i64) (result i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $1 i32)
|
2018-05-11 16:31:56 +02:00
|
|
|
(local $2 i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $3 i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
|
|
|
i32.wrap_i64
|
|
|
|
local.set $1
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i64.const 32
|
|
|
|
i64.shr_u
|
2019-02-05 17:12:10 +01:00
|
|
|
i32.wrap_i64
|
|
|
|
local.set $2
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const -2128831035
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
2019-02-21 00:11:22 +01:00
|
|
|
i32.const 16777619
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $3
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-02-21 00:11:22 +01:00
|
|
|
(func $start:std/hash (; 4 ;) (type $_)
|
2018-05-11 16:31:56 +02:00
|
|
|
(local $0 i32)
|
|
|
|
(local $1 f32)
|
|
|
|
(local $2 f64)
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<String>|inlined.0 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hashStr
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<String>|inlined.0
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<String>|inlined.1 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hashStr
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<String>|inlined.1
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<String>|inlined.2 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hashStr
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<String>|inlined.2
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<String>|inlined.3 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hashStr
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<String>|inlined.3
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<String>|inlined.4 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 32
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hashStr
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<String>|inlined.4
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.0 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.0
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.1 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const 1
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.1
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.2 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const 1.100000023841858
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.2
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.3 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.3
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.4 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const inf
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.4
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f32>|inlined.5 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const nan:0x400000
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
|
|
|
local.get $1
|
|
|
|
i32.reinterpret_f32
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash32
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f32>|inlined.5
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.0 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.0
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.1 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 1
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.1
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.2 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 1.1
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.2
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.3 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.3
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.4 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const inf
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.4
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-12-08 23:38:49 +01:00
|
|
|
block $~lib/internal/hash/HASH<f64>|inlined.5 (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const nan:0x8000000000000
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
|
|
|
i64.reinterpret_f64
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/internal/hash/hash64
|
2018-12-08 23:38:49 +01:00
|
|
|
br $~lib/internal/hash/HASH<f64>|inlined.5
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
call $std/hash/check
|
|
|
|
drop
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-02-21 00:11:22 +01:00
|
|
|
(func $start (; 5 ;) (type $_)
|
|
|
|
call $start:std/hash
|
|
|
|
)
|
|
|
|
(func $null (; 6 ;) (type $_)
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|