Use stack IR when emitting text format (#312)

This commit is contained in:
Daniel Wirtz
2018-11-08 08:04:24 +01:00
committed by GitHub
parent 7135af36bd
commit 2bdc2a72f1
194 changed files with 239934 additions and 340697 deletions

View File

@ -5,72 +5,56 @@
(type $FUNCSIG$f (func (result f32)))
(memory $0 1)
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $class/Animal.ONE (mut i32) (i32.const 1))
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $class/test))
(start $start)
(func $class/Animal.add (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32)
(i32.add
(get_global $class/Animal.ONE)
(i32.const 3)
)
(func $class/Animal.add (; 0 ;) (type $FUNCSIG$i) (result i32)
get_global $class/Animal.ONE
i32.const 3
i32.add
)
(func $class/Animal.sub<f32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32)
(f32.add
(f32.const -1)
(f32.convert_s/i32
(get_global $class/Animal.ONE)
)
)
(func $class/Animal.sub<f32> (; 1 ;) (type $FUNCSIG$f) (result f32)
f32.const -1
get_global $class/Animal.ONE
f32.convert_s/i32
f32.add
)
(func $class/test (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(drop
(call $class/Animal.add)
)
(drop
(call $class/Animal.sub<f32>)
)
(drop
(i32.load
(get_local $0)
)
)
(drop
(i32.load16_s offset=4
(get_local $0)
)
)
(drop
(i32.load8_s offset=6
(get_local $0)
)
)
(i32.store
(get_local $0)
(i32.const 1)
)
(i32.store16 offset=4
(get_local $0)
(i32.const 2)
)
(i32.store8 offset=6
(get_local $0)
(i32.const 3)
)
(get_local $0)
(func $class/test (; 2 ;) (type $ii) (param $0 i32) (result i32)
call $class/Animal.add
drop
call $class/Animal.sub<f32>
drop
get_local $0
i32.load
drop
get_local $0
i32.load16_s offset=4
drop
get_local $0
i32.load8_s offset=6
drop
get_local $0
i32.const 1
i32.store
get_local $0
i32.const 2
i32.store16 offset=4
get_local $0
i32.const 3
i32.store8 offset=6
get_local $0
)
(func $start (; 3 ;) (; has Stack IR ;) (type $v)
(drop
(call $class/Animal.add)
)
(drop
(call $class/Animal.sub<f32>)
)
(func $start (; 3 ;) (type $v)
call $class/Animal.add
drop
call $class/Animal.sub<f32>
drop
)
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 4 ;) (type $v)
nop
)
)