assemblyscript/tests/compiler/std/hash.optimized.wat

213 lines
3.8 KiB
Plaintext
Raw Normal View History

(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$ij (func (param i64) (result i32)))
(type $FUNCSIG$v (func))
(memory $0 1)
2019-05-23 03:08:25 +02:00
(data (i32.const 12) "\01\00\00\00\01")
(data (i32.const 24) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a")
(data (i32.const 48) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b")
(data (i32.const 72) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c")
(export "memory" (memory $0))
(start $start)
2019-03-17 01:35:44 +01:00
(func $~lib/util/hash/hashStr (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
i32.const -2128831035
2019-03-17 01:35:44 +01:00
local.set $1
local.get $0
2019-03-17 01:35:44 +01:00
if
2018-12-01 03:09:43 +01:00
block $break|0
local.get $0
2019-04-08 23:22:13 +02:00
i32.const 16
2019-03-17 01:35:44 +01:00
i32.sub
2019-05-23 03:08:25 +02:00
i32.load offset=12
i32.const 1
2019-03-17 01:35:44 +01:00
i32.shr_u
i32.const 1
i32.shl
local.set $3
loop $repeat|0
local.get $2
local.get $3
i32.ge_u
br_if $break|0
local.get $0
local.get $2
i32.add
i32.load8_u
local.get $1
i32.xor
i32.const 16777619
i32.mul
local.set $1
local.get $2
i32.const 1
i32.add
local.set $2
br $repeat|0
unreachable
end
unreachable
end
end
2019-03-17 01:35:44 +01:00
local.get $1
)
2019-03-17 01:35:44 +01:00
(func $~lib/util/hash/hash32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 255
i32.and
i32.const -2128831035
i32.xor
i32.const 16777619
i32.mul
local.get $0
i32.const 8
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $0
i32.const 16
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $0
i32.const 24
i32.shr_u
i32.xor
i32.const 16777619
i32.mul
)
2019-03-17 01:35:44 +01:00
(func $~lib/util/hash/hash64 (; 2 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
(local $1 i32)
local.get $0
i32.wrap_i64
local.tee $1
i32.const 255
i32.and
i32.const -2128831035
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 8
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 16
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 24
i32.shr_u
i32.xor
i32.const 16777619
i32.mul
local.get $0
i64.const 32
i64.shr_u
i32.wrap_i64
local.tee $1
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 8
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 16
i32.shr_u
i32.const 255
i32.and
i32.xor
i32.const 16777619
i32.mul
local.get $1
i32.const 24
i32.shr_u
i32.xor
i32.const 16777619
i32.mul
)
(func $start:std/hash (; 3 ;) (type $FUNCSIG$v)
i32.const 0
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hashStr
drop
i32.const 24
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hashStr
drop
i32.const 40
call $~lib/util/hash/hashStr
drop
2019-04-08 23:22:13 +02:00
i32.const 64
call $~lib/util/hash/hashStr
drop
i32.const 88
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hashStr
drop
i32.const 0
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i32.const 1065353216
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i32.const 1066192077
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i32.const 0
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i32.const 2139095040
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i32.const 2143289344
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash32
drop
i64.const 0
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
i64.const 4607182418800017408
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
i64.const 4607632778762754458
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
i64.const 0
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
i64.const 9218868437227405312
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
i64.const 9221120237041090560
2019-03-17 01:35:44 +01:00
call $~lib/util/hash/hash64
drop
)
(func $start (; 4 ;) (type $FUNCSIG$v)
call $start:std/hash
)
(func $null (; 5 ;) (type $FUNCSIG$v)
nop
)
)