Implicitly alias stdlib exports as program globals, see #8

This commit is contained in:
dcodeIO
2018-01-12 15:36:17 +01:00
parent 3980e53bb7
commit 2df318a7ec
27 changed files with 417 additions and 179 deletions

View File

@ -13,85 +13,90 @@
(local $1 f64)
(drop
(if (result i32)
(i32.eqz
(i32.ne
(i32.const 0)
(i32.const 0)
)
(i32.const 0)
(unreachable)
(i32.const 0)
)
)
(drop
(if (result f64)
(f64.eq
(f64.ne
(f64.const 0)
(f64.const 0)
)
(f64.const 0)
(unreachable)
(f64.const 0)
)
)
(drop
(if (result i32)
(i32.eqz
(i32.ne
(i32.const 1)
(i32.const 0)
)
(unreachable)
(i32.const 1)
(unreachable)
)
)
(drop
(if (result f64)
(f64.eq
(f64.ne
(f64.const 1)
(f64.const 0)
)
(unreachable)
(f64.const 1)
(unreachable)
)
)
(drop
(if (result i32)
(i32.eqz
(i32.ne
(tee_local $0
(if (result i32)
(i32.eqz
(i32.ne
(i32.const 1)
(i32.const 0)
)
(i32.const 1)
(i32.const 2)
(i32.const 1)
)
)
(i32.const 0)
)
(unreachable)
(get_local $0)
(unreachable)
)
)
(drop
(if (result f64)
(f64.eq
(f64.ne
(tee_local $1
(if (result f64)
(f64.eq
(f64.ne
(f64.const 1)
(f64.const 0)
)
(f64.const 1)
(f64.const 2)
(f64.const 1)
)
)
(f64.const 0)
)
(unreachable)
(get_local $1)
(unreachable)
)
)
(set_global $logical/i
(if (result i32)
(i32.eqz
(i32.ne
(i32.const 1)
(i32.const 0)
)
(i32.const 1)
(i32.const 2)
(i32.const 1)
)
)
(if
@ -105,11 +110,12 @@
)
(set_global $logical/i
(if (result i32)
(i32.eqz
(i32.ne
(i32.const 0)
(i32.const 0)
)
(i32.const 1)
(i32.const 0)
(i32.const 1)
)
)
(if
@ -123,11 +129,12 @@
)
(set_global $logical/I
(if (result i64)
(i64.eqz
(i64.ne
(i64.const 1)
(i64.const 0)
)
(i64.const 1)
(i64.const 2)
(i64.const 1)
)
)
(if
@ -141,11 +148,12 @@
)
(set_global $logical/I
(if (result i64)
(i64.eqz
(i64.ne
(i64.const 0)
(i64.const 0)
)
(i64.const 1)
(i64.const 0)
(i64.const 1)
)
)
(if
@ -159,12 +167,12 @@
)
(set_global $logical/f
(if (result f32)
(f32.eq
(f32.ne
(f32.const 1)
(f32.const 0)
)
(f32.const 1)
(f32.const 2)
(f32.const 1)
)
)
(if
@ -178,12 +186,12 @@
)
(set_global $logical/f
(if (result f32)
(f32.eq
(f32.ne
(f32.const 0)
(f32.const 0)
)
(f32.const 1)
(f32.const 0)
(f32.const 1)
)
)
(if
@ -197,12 +205,12 @@
)
(set_global $logical/F
(if (result f64)
(f64.eq
(f64.ne
(f64.const 1)
(f64.const 0)
)
(f64.const 1)
(f64.const 2)
(f64.const 1)
)
)
(if
@ -216,12 +224,12 @@
)
(set_global $logical/F
(if (result f64)
(f64.eq
(f64.ne
(f64.const 0)
(f64.const 0)
)
(f64.const 1)
(f64.const 0)
(f64.const 1)
)
)
(if