Let the optimizer decide what it takes to become a select

This commit is contained in:
dcodeIO
2018-01-12 05:03:25 +01:00
parent d89703cdad
commit 3980e53bb7
18 changed files with 225 additions and 242 deletions

View File

@ -53,12 +53,12 @@
(if (result i32)
(i32.eqz
(tee_local $0
(select
(i32.const 1)
(i32.const 2)
(if (result i32)
(i32.eqz
(i32.const 1)
)
(i32.const 1)
(i32.const 2)
)
)
)
@ -70,13 +70,13 @@
(if (result f64)
(f64.eq
(tee_local $1
(select
(f64.const 1)
(f64.const 2)
(if (result f64)
(f64.eq
(f64.const 1)
(f64.const 0)
)
(f64.const 1)
(f64.const 2)
)
)
(f64.const 0)
@ -86,12 +86,12 @@
)
)
(set_global $logical/i
(select
(i32.const 1)
(i32.const 2)
(if (result i32)
(i32.eqz
(i32.const 1)
)
(i32.const 1)
(i32.const 2)
)
)
(if
@ -104,12 +104,12 @@
(unreachable)
)
(set_global $logical/i
(select
(i32.const 1)
(i32.const 0)
(if (result i32)
(i32.eqz
(i32.const 0)
)
(i32.const 1)
(i32.const 0)
)
)
(if
@ -122,12 +122,12 @@
(unreachable)
)
(set_global $logical/I
(select
(i64.const 1)
(i64.const 2)
(if (result i64)
(i64.eqz
(i64.const 1)
)
(i64.const 1)
(i64.const 2)
)
)
(if
@ -140,12 +140,12 @@
(unreachable)
)
(set_global $logical/I
(select
(i64.const 1)
(i64.const 0)
(if (result i64)
(i64.eqz
(i64.const 0)
)
(i64.const 1)
(i64.const 0)
)
)
(if
@ -158,13 +158,13 @@
(unreachable)
)
(set_global $logical/f
(select
(f32.const 1)
(f32.const 2)
(if (result f32)
(f32.eq
(f32.const 1)
(f32.const 0)
)
(f32.const 1)
(f32.const 2)
)
)
(if
@ -177,13 +177,13 @@
(unreachable)
)
(set_global $logical/f
(select
(f32.const 1)
(f32.const 0)
(if (result f32)
(f32.eq
(f32.const 0)
(f32.const 0)
)
(f32.const 1)
(f32.const 0)
)
)
(if
@ -196,13 +196,13 @@
(unreachable)
)
(set_global $logical/F
(select
(f64.const 1)
(f64.const 2)
(if (result f64)
(f64.eq
(f64.const 1)
(f64.const 0)
)
(f64.const 1)
(f64.const 2)
)
)
(if
@ -215,13 +215,13 @@
(unreachable)
)
(set_global $logical/F
(select
(f64.const 1)
(f64.const 0)
(if (result f64)
(f64.eq
(f64.const 0)
(f64.const 0)
)
(f64.const 1)
(f64.const 0)
)
)
(if