More smarter temp locals

This commit is contained in:
dcodeIO
2017-12-12 09:38:20 +01:00
parent f75b962c74
commit c8680b1e77
5 changed files with 631 additions and 709 deletions

View File

@ -11,20 +11,8 @@
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 f64)
(local $2 i32)
(local $3 f64)
(local $4 i32)
(local $5 i32)
(local $6 f64)
(local $7 f64)
(local $8 i32)
(local $9 i32)
(local $10 i64)
(local $11 i64)
(local $12 f32)
(local $13 f32)
(local $14 f64)
(local $15 f64)
(local $2 i64)
(local $3 f32)
(drop
(if (result i32)
(tee_local $0
@ -48,68 +36,68 @@
)
(drop
(if (result i32)
(tee_local $2
(tee_local $0
(i32.const 1)
)
(get_local $2)
(get_local $0)
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
(tee_local $3
(tee_local $1
(f64.const 1)
)
(f64.const 0)
)
(get_local $3)
(get_local $1)
(unreachable)
)
)
(drop
(if (result i32)
(tee_local $5
(tee_local $0
(if (result i32)
(tee_local $4
(tee_local $0
(i32.const 1)
)
(i32.const 2)
(get_local $4)
(get_local $0)
)
)
(get_local $5)
(get_local $0)
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
(tee_local $7
(tee_local $1
(if (result f64)
(f64.ne
(tee_local $6
(tee_local $1
(f64.const 1)
)
(f64.const 0)
)
(f64.const 2)
(get_local $6)
(get_local $1)
)
)
(f64.const 0)
)
(get_local $7)
(get_local $1)
(unreachable)
)
)
(set_global $logical/i
(if (result i32)
(tee_local $8
(tee_local $0
(i32.const 1)
)
(i32.const 2)
(get_local $8)
(get_local $0)
)
)
(if
@ -123,10 +111,10 @@
)
(set_global $logical/i
(if (result i32)
(tee_local $9
(tee_local $0
(i32.const 0)
)
(get_local $9)
(get_local $0)
(i32.const 1)
)
)
@ -142,13 +130,13 @@
(set_global $logical/I
(if (result i64)
(i64.ne
(tee_local $10
(tee_local $2
(i64.const 1)
)
(i64.const 0)
)
(i64.const 2)
(get_local $10)
(get_local $2)
)
)
(if
@ -163,12 +151,12 @@
(set_global $logical/I
(if (result i64)
(i64.ne
(tee_local $11
(tee_local $2
(i64.const 0)
)
(i64.const 0)
)
(get_local $11)
(get_local $2)
(i64.const 1)
)
)
@ -184,13 +172,13 @@
(set_global $logical/f
(if (result f32)
(f32.ne
(tee_local $12
(tee_local $3
(f32.const 1)
)
(f32.const 0)
)
(f32.const 2)
(get_local $12)
(get_local $3)
)
)
(if
@ -205,12 +193,12 @@
(set_global $logical/f
(if (result f32)
(f32.ne
(tee_local $13
(tee_local $3
(f32.const 0)
)
(f32.const 0)
)
(get_local $13)
(get_local $3)
(f32.const 1)
)
)
@ -226,13 +214,13 @@
(set_global $logical/F
(if (result f64)
(f64.ne
(tee_local $14
(tee_local $1
(f64.const 1)
)
(f64.const 0)
)
(f64.const 2)
(get_local $14)
(get_local $1)
)
)
(if
@ -247,12 +235,12 @@
(set_global $logical/F
(if (result f64)
(f64.ne
(tee_local $15
(tee_local $1
(f64.const 0)
)
(f64.const 0)
)
(get_local $15)
(get_local $1)
(f64.const 1)
)
)