mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 03:01:55 +00:00
Use stack IR when emitting text format (#312)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
(module
|
||||
(type $v (func))
|
||||
(memory $0 0)
|
||||
(table 1 anyfunc)
|
||||
(table $0 1 anyfunc)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $unary/i (mut i32) (i32.const 0))
|
||||
(global $unary/I (mut i64) (i64.const 0))
|
||||
@ -10,347 +10,231 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (; has Stack IR ;) (type $v)
|
||||
(func $start (; 0 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i64)
|
||||
(local $2 f32)
|
||||
(local $3 f64)
|
||||
(set_global $unary/i
|
||||
(i32.add
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.sub
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.add
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.sub
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.const -1)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.const 0)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.const -2)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(get_global $unary/i)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.eqz
|
||||
(get_global $unary/i)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.xor
|
||||
(get_global $unary/i)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.add
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.sub
|
||||
(get_global $unary/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.add
|
||||
(tee_local $0
|
||||
(get_global $unary/i)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(get_local $0)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.sub
|
||||
(tee_local $0
|
||||
(get_global $unary/i)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(get_local $0)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.add
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.sub
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.add
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.sub
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.const 1)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.const -1)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.const 0)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.const -2)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.sub
|
||||
(i64.const 0)
|
||||
(get_global $unary/I)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.extend_u/i32
|
||||
(i64.eqz
|
||||
(get_global $unary/I)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.xor
|
||||
(get_global $unary/I)
|
||||
(i64.const -1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.add
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.sub
|
||||
(get_global $unary/I)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.add
|
||||
(tee_local $1
|
||||
(get_global $unary/I)
|
||||
)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(get_local $1)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.sub
|
||||
(tee_local $1
|
||||
(get_global $unary/I)
|
||||
)
|
||||
(i64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(get_local $1)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.add
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.sub
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.add
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.sub
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.const 1.25)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.const -1.25)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(i32.const 0)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.neg
|
||||
(get_global $unary/f)
|
||||
)
|
||||
)
|
||||
(set_global $unary/i
|
||||
(f32.eq
|
||||
(get_global $unary/f)
|
||||
(f32.const 0)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.add
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.sub
|
||||
(get_global $unary/f)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.add
|
||||
(tee_local $2
|
||||
(get_global $unary/f)
|
||||
)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(get_local $2)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(f32.sub
|
||||
(tee_local $2
|
||||
(get_global $unary/f)
|
||||
)
|
||||
(f32.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/f
|
||||
(get_local $2)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.add
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.sub
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.add
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.sub
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.const 1.25)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.const -1.25)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.const 0)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.neg
|
||||
(get_global $unary/F)
|
||||
)
|
||||
)
|
||||
(set_global $unary/I
|
||||
(i64.extend_u/i32
|
||||
(f64.eq
|
||||
(get_global $unary/F)
|
||||
(f64.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.add
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.sub
|
||||
(get_global $unary/F)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.add
|
||||
(tee_local $3
|
||||
(get_global $unary/F)
|
||||
)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(get_local $3)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(f64.sub
|
||||
(tee_local $3
|
||||
(get_global $unary/F)
|
||||
)
|
||||
(f64.const 1)
|
||||
)
|
||||
)
|
||||
(set_global $unary/F
|
||||
(get_local $3)
|
||||
)
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.sub
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.sub
|
||||
set_global $unary/i
|
||||
i32.const 1
|
||||
set_global $unary/i
|
||||
i32.const -1
|
||||
set_global $unary/i
|
||||
i32.const 0
|
||||
set_global $unary/i
|
||||
i32.const -2
|
||||
set_global $unary/i
|
||||
i32.const 0
|
||||
get_global $unary/i
|
||||
i32.sub
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.eqz
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const -1
|
||||
i32.xor
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
i32.const 1
|
||||
i32.sub
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
tee_local $0
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_global $unary/i
|
||||
get_local $0
|
||||
set_global $unary/i
|
||||
get_global $unary/i
|
||||
tee_local $0
|
||||
i32.const 1
|
||||
i32.sub
|
||||
set_global $unary/i
|
||||
get_local $0
|
||||
set_global $unary/i
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.add
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.sub
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.add
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.sub
|
||||
set_global $unary/I
|
||||
i64.const 1
|
||||
set_global $unary/I
|
||||
i64.const -1
|
||||
set_global $unary/I
|
||||
i64.const 0
|
||||
set_global $unary/I
|
||||
i64.const -2
|
||||
set_global $unary/I
|
||||
i64.const 0
|
||||
get_global $unary/I
|
||||
i64.sub
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.eqz
|
||||
i64.extend_u/i32
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const -1
|
||||
i64.xor
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.add
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
i64.const 1
|
||||
i64.sub
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
tee_local $1
|
||||
i64.const 1
|
||||
i64.add
|
||||
set_global $unary/I
|
||||
get_local $1
|
||||
set_global $unary/I
|
||||
get_global $unary/I
|
||||
tee_local $1
|
||||
i64.const 1
|
||||
i64.sub
|
||||
set_global $unary/I
|
||||
get_local $1
|
||||
set_global $unary/I
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.add
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.sub
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.add
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.sub
|
||||
set_global $unary/f
|
||||
f32.const 1.25
|
||||
set_global $unary/f
|
||||
f32.const -1.25
|
||||
set_global $unary/f
|
||||
i32.const 0
|
||||
set_global $unary/i
|
||||
get_global $unary/f
|
||||
f32.neg
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
f32.const 0
|
||||
f32.eq
|
||||
set_global $unary/i
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.add
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
f32.const 1
|
||||
f32.sub
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
tee_local $2
|
||||
f32.const 1
|
||||
f32.add
|
||||
set_global $unary/f
|
||||
get_local $2
|
||||
set_global $unary/f
|
||||
get_global $unary/f
|
||||
tee_local $2
|
||||
f32.const 1
|
||||
f32.sub
|
||||
set_global $unary/f
|
||||
get_local $2
|
||||
set_global $unary/f
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.add
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.sub
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.add
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.sub
|
||||
set_global $unary/F
|
||||
f64.const 1.25
|
||||
set_global $unary/F
|
||||
f64.const -1.25
|
||||
set_global $unary/F
|
||||
i64.const 0
|
||||
set_global $unary/I
|
||||
get_global $unary/F
|
||||
f64.neg
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
f64.const 0
|
||||
f64.eq
|
||||
i64.extend_u/i32
|
||||
set_global $unary/I
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.add
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
f64.const 1
|
||||
f64.sub
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
tee_local $3
|
||||
f64.const 1
|
||||
f64.add
|
||||
set_global $unary/F
|
||||
get_local $3
|
||||
set_global $unary/F
|
||||
get_global $unary/F
|
||||
tee_local $3
|
||||
f64.const 1
|
||||
f64.sub
|
||||
set_global $unary/F
|
||||
get_local $3
|
||||
set_global $unary/F
|
||||
)
|
||||
(func $null (; 1 ;) (; has Stack IR ;) (type $v)
|
||||
(nop)
|
||||
(func $null (; 1 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user