assemblyscript/tests/compiler/tlsf.optimized.wast

306 lines
5.0 KiB
Plaintext
Raw Normal View History

2017-12-06 19:33:48 +01:00
(module
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
(memory $0 1)
(export "control$construct" (func $tlsf/control$construct))
2017-12-06 19:33:48 +01:00
(export "memory" (memory $0))
(start $start)
(func $tlsf/fls (; 0 ;) (type $ii) (param $0 i32) (result i32)
(select
;;@ tlsf.ts:7:21
2017-12-06 19:33:48 +01:00
(i32.sub
(i32.const 31)
;;@ tlsf.ts:7:26
2017-12-06 19:33:48 +01:00
(i32.clz
;;@ tlsf.ts:7:35
2017-12-06 19:33:48 +01:00
(get_local $0)
)
)
(i32.const -1)
;;@ tlsf.ts:7:10
(get_local $0)
2017-12-06 19:33:48 +01:00
)
)
(func $tlsf/ffs (; 1 ;) (type $ii) (param $0 i32) (result i32)
(select
;;@ tlsf.ts:17:22
2017-12-06 19:33:48 +01:00
(i32.ctz
;;@ tlsf.ts:17:31
2017-12-06 19:33:48 +01:00
(get_local $0)
)
(i32.const -1)
;;@ tlsf.ts:17:10
(get_local $0)
2017-12-06 19:33:48 +01:00
)
)
(func $tlsf/control$set_block (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
;;@ tlsf.ts:173:2
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:173:9
(i32.ge_u
2017-12-06 19:33:48 +01:00
(get_local $1)
;;@ tlsf.ts:173:19
(i32.const 23)
2017-12-06 19:33:48 +01:00
)
(unreachable)
)
;;@ tlsf.ts:174:2
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:174:9
(i32.ge_u
2017-12-06 19:33:48 +01:00
(get_local $2)
;;@ tlsf.ts:174:19
(i32.const 32)
2017-12-06 19:33:48 +01:00
)
(unreachable)
)
;;@ tlsf.ts:175:2
2017-12-06 19:33:48 +01:00
(i32.store
;;@ tlsf.ts:175:15
2017-12-06 19:33:48 +01:00
(i32.add
(i32.add
(get_local $0)
;;@ tlsf.ts:175:21
(i32.const 112)
)
;;@ tlsf.ts:175:45
2017-12-06 19:33:48 +01:00
(i32.mul
(i32.add
;;@ tlsf.ts:175:46
2017-12-06 19:33:48 +01:00
(i32.mul
(get_local $1)
;;@ tlsf.ts:175:56
(i32.const 32)
2017-12-06 19:33:48 +01:00
)
;;@ tlsf.ts:175:73
2017-12-06 19:33:48 +01:00
(get_local $2)
)
;;@ tlsf.ts:175:84
2017-12-06 19:33:48 +01:00
(i32.const 4)
)
)
;;@ tlsf.ts:175:101
2017-12-06 19:33:48 +01:00
(get_local $3)
)
)
(func $tlsf/control$construct (; 3 ;) (type $iv) (param $0 i32)
2017-12-06 19:33:48 +01:00
(local $1 i32)
(local $2 i32)
(local $3 i32)
(i32.store
(i32.add
(tee_local $3
;;@ tlsf.ts:180:22
(get_local $0)
)
(i32.const 8)
)
(tee_local $1
;;@ tlsf.ts:180:27
(get_local $0)
)
2017-12-06 19:33:48 +01:00
)
(i32.store
(i32.add
(tee_local $3
;;@ tlsf.ts:181:22
(get_local $0)
)
(i32.const 12)
)
(tee_local $1
;;@ tlsf.ts:181:27
(get_local $0)
)
2017-12-06 19:33:48 +01:00
)
(i32.store
(i32.add
(tee_local $1
;;@ tlsf.ts:182:24
(get_local $0)
)
(i32.const 16)
)
2017-12-06 19:33:48 +01:00
(i32.const 0)
)
2017-12-08 16:11:58 +01:00
(loop $continue|0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:183:31
(i32.lt_u
(get_local $2)
;;@ tlsf.ts:183:41
(i32.const 23)
2017-12-06 19:33:48 +01:00
)
(block
(set_local $3
;;@ tlsf.ts:184:26
2017-12-06 19:33:48 +01:00
(get_local $0)
)
(if
(i32.ge_u
(tee_local $1
;;@ tlsf.ts:184:31
(get_local $2)
)
(i32.const 23)
)
(unreachable)
)
(i32.store
(i32.add
(i32.add
(get_local $3)
(i32.const 20)
)
(i32.mul
(get_local $1)
(i32.const 4)
)
)
2017-12-06 19:33:48 +01:00
(i32.const 0)
)
;;@ tlsf.ts:185:9
(set_local $1
;;@ tlsf.ts:185:30
2017-12-06 19:33:48 +01:00
(i32.const 0)
)
2017-12-08 16:11:58 +01:00
(loop $continue|1
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:185:33
(i32.lt_u
(get_local $1)
;;@ tlsf.ts:185:43
(i32.const 32)
2017-12-06 19:33:48 +01:00
)
(block
;;@ tlsf.ts:186:6
(call $tlsf/control$set_block
;;@ tlsf.ts:186:24
2017-12-06 19:33:48 +01:00
(get_local $0)
;;@ tlsf.ts:186:29
2017-12-06 19:33:48 +01:00
(get_local $2)
;;@ tlsf.ts:186:38
(get_local $1)
;;@ tlsf.ts:186:47
2017-12-06 19:33:48 +01:00
(get_local $0)
)
;;@ tlsf.ts:185:59
(set_local $1
2017-12-06 19:33:48 +01:00
(i32.add
;;@ tlsf.ts:185:61
(get_local $1)
2017-12-06 19:33:48 +01:00
(i32.const 1)
)
)
2017-12-08 16:11:58 +01:00
(br $continue|1)
2017-12-06 19:33:48 +01:00
)
)
)
;;@ tlsf.ts:183:57
(set_local $2
2017-12-06 19:33:48 +01:00
(i32.add
;;@ tlsf.ts:183:59
(get_local $2)
2017-12-06 19:33:48 +01:00
(i32.const 1)
)
)
2017-12-08 16:11:58 +01:00
(br $continue|0)
2017-12-06 19:33:48 +01:00
)
)
)
)
(func $start (; 4 ;) (type $v)
;;@ tlsf.ts:10:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:10:7
2017-12-06 19:33:48 +01:00
(i32.ne
(call $tlsf/fls
;;@ tlsf.ts:10:11
2017-12-06 19:33:48 +01:00
(i32.const 0)
)
(i32.const -1)
)
(unreachable)
)
;;@ tlsf.ts:11:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:11:7
2017-12-06 19:33:48 +01:00
(call $tlsf/fls
;;@ tlsf.ts:11:11
2017-12-06 19:33:48 +01:00
(i32.const 1)
)
(unreachable)
)
;;@ tlsf.ts:12:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:12:7
2017-12-06 19:33:48 +01:00
(i32.ne
(call $tlsf/fls
;;@ tlsf.ts:12:11
2017-12-06 19:33:48 +01:00
(i32.const -2147483640)
)
;;@ tlsf.ts:12:26
2017-12-06 19:33:48 +01:00
(i32.const 31)
)
(unreachable)
)
;;@ tlsf.ts:13:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:13:7
2017-12-06 19:33:48 +01:00
(i32.ne
(call $tlsf/fls
;;@ tlsf.ts:13:11
2017-12-06 19:33:48 +01:00
(i32.const 2147483647)
)
;;@ tlsf.ts:13:26
2017-12-06 19:33:48 +01:00
(i32.const 30)
)
(unreachable)
)
;;@ tlsf.ts:20:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:20:7
2017-12-06 19:33:48 +01:00
(i32.ne
(call $tlsf/ffs
;;@ tlsf.ts:20:11
2017-12-06 19:33:48 +01:00
(i32.const 0)
)
(i32.const -1)
)
(unreachable)
)
;;@ tlsf.ts:21:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:21:7
2017-12-06 19:33:48 +01:00
(call $tlsf/ffs
;;@ tlsf.ts:21:11
2017-12-06 19:33:48 +01:00
(i32.const 1)
)
(unreachable)
)
;;@ tlsf.ts:22:0
2017-12-06 19:33:48 +01:00
(if
;;@ tlsf.ts:22:7
2017-12-06 19:33:48 +01:00
(i32.ne
(call $tlsf/ffs
;;@ tlsf.ts:22:11
2017-12-06 19:33:48 +01:00
(i32.const -2147483648)
)
;;@ tlsf.ts:22:26
2017-12-06 19:33:48 +01:00
(i32.const 31)
)
(unreachable)
)
;;@ tlsf.ts:190:0
(call $tlsf/control$construct
;;@ tlsf.ts:190:18
2017-12-06 19:33:48 +01:00
(i32.load
;;@ tlsf.ts:190:30
(i32.const 4)
2017-12-06 19:33:48 +01:00
)
)
)
)