311 lines
4.1 KiB
Plaintext
Raw Normal View History

2017-12-04 16:26:34 +01:00
(module
(type $v (func))
2017-12-04 19:26:50 +01:00
(global $logical/i (mut i32) (i32.const 0))
(global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0))
(global $logical/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
2017-12-04 16:26:34 +01:00
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 f64)
2017-12-12 09:38:20 +01:00
(local $2 i64)
(local $3 f32)
2017-12-04 16:26:34 +01:00
(drop
(if (result i32)
(tee_local $0
(i32.const 0)
)
(unreachable)
(get_local $0)
)
)
(drop
(if (result f64)
(f64.ne
(tee_local $1
(f64.const 0)
)
(f64.const 0)
)
(unreachable)
(get_local $1)
)
)
(drop
(if (result i32)
2017-12-12 09:38:20 +01:00
(tee_local $0
2017-12-04 16:26:34 +01:00
(i32.const 1)
)
2017-12-12 09:38:20 +01:00
(get_local $0)
2017-12-04 16:26:34 +01:00
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
2017-12-12 09:38:20 +01:00
(tee_local $1
2017-12-04 16:26:34 +01:00
(f64.const 1)
)
(f64.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $1)
2017-12-04 16:26:34 +01:00
(unreachable)
)
)
(drop
(if (result i32)
2017-12-12 09:38:20 +01:00
(tee_local $0
2017-12-04 16:26:34 +01:00
(if (result i32)
2017-12-12 09:38:20 +01:00
(tee_local $0
2017-12-04 16:26:34 +01:00
(i32.const 1)
)
(i32.const 2)
2017-12-12 09:38:20 +01:00
(get_local $0)
2017-12-04 16:26:34 +01:00
)
)
2017-12-12 09:38:20 +01:00
(get_local $0)
2017-12-04 16:26:34 +01:00
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
2017-12-12 09:38:20 +01:00
(tee_local $1
2017-12-04 16:26:34 +01:00
(if (result f64)
(f64.ne
2017-12-12 09:38:20 +01:00
(tee_local $1
2017-12-04 16:26:34 +01:00
(f64.const 1)
)
(f64.const 0)
)
(f64.const 2)
2017-12-12 09:38:20 +01:00
(get_local $1)
2017-12-04 16:26:34 +01:00
)
)
(f64.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $1)
2017-12-04 16:26:34 +01:00
(unreachable)
)
)
2017-12-04 19:26:50 +01:00
(set_global $logical/i
(if (result i32)
2017-12-12 09:38:20 +01:00
(tee_local $0
2017-12-04 19:26:50 +01:00
(i32.const 1)
)
(i32.const 2)
2017-12-12 09:38:20 +01:00
(get_local $0)
2017-12-04 19:26:50 +01:00
)
)
(if
(i32.eqz
(i32.eq
(get_global $logical/i)
(i32.const 2)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/i
(if (result i32)
2017-12-12 09:38:20 +01:00
(tee_local $0
2017-12-04 19:26:50 +01:00
(i32.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $0)
2017-12-04 19:26:50 +01:00
(i32.const 1)
)
)
(if
(i32.eqz
(i32.eq
(get_global $logical/i)
(i32.const 1)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/I
(if (result i64)
(i64.ne
2017-12-12 09:38:20 +01:00
(tee_local $2
2017-12-04 19:26:50 +01:00
(i64.const 1)
)
(i64.const 0)
)
(i64.const 2)
2017-12-12 09:38:20 +01:00
(get_local $2)
2017-12-04 19:26:50 +01:00
)
)
(if
(i32.eqz
(i64.eq
(get_global $logical/I)
(i64.const 2)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/I
(if (result i64)
(i64.ne
2017-12-12 09:38:20 +01:00
(tee_local $2
2017-12-04 19:26:50 +01:00
(i64.const 0)
)
(i64.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $2)
2017-12-04 19:26:50 +01:00
(i64.const 1)
)
)
(if
(i32.eqz
(i64.eq
(get_global $logical/I)
(i64.const 1)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/f
(if (result f32)
(f32.ne
2017-12-12 09:38:20 +01:00
(tee_local $3
2017-12-04 19:26:50 +01:00
(f32.const 1)
)
(f32.const 0)
)
(f32.const 2)
2017-12-12 09:38:20 +01:00
(get_local $3)
2017-12-04 19:26:50 +01:00
)
)
(if
(i32.eqz
(f32.eq
(get_global $logical/f)
(f32.const 2)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/f
(if (result f32)
(f32.ne
2017-12-12 09:38:20 +01:00
(tee_local $3
2017-12-04 19:26:50 +01:00
(f32.const 0)
)
(f32.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $3)
2017-12-04 19:26:50 +01:00
(f32.const 1)
)
)
(if
(i32.eqz
(f32.eq
(get_global $logical/f)
(f32.const 1)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/F
(if (result f64)
(f64.ne
2017-12-12 09:38:20 +01:00
(tee_local $1
2017-12-04 19:26:50 +01:00
(f64.const 1)
)
(f64.const 0)
)
(f64.const 2)
2017-12-12 09:38:20 +01:00
(get_local $1)
2017-12-04 19:26:50 +01:00
)
)
(if
(i32.eqz
(f64.eq
(get_global $logical/F)
(f64.const 2)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
(set_global $logical/F
(if (result f64)
(f64.ne
2017-12-12 09:38:20 +01:00
(tee_local $1
2017-12-04 19:26:50 +01:00
(f64.const 0)
)
(f64.const 0)
)
2017-12-12 09:38:20 +01:00
(get_local $1)
2017-12-04 19:26:50 +01:00
(f64.const 1)
)
)
(if
(i32.eqz
(f64.eq
(get_global $logical/F)
(f64.const 1)
)
2017-12-04 19:26:50 +01:00
)
(unreachable)
)
2017-12-04 16:26:34 +01:00
)
)
(;
[program.elements]
2017-12-16 02:27:39 +01:00
NaN
Infinity
2017-12-15 17:23:04 +01:00
isNaN
isFinite
2017-12-04 16:26:34 +01:00
clz
ctz
popcnt
rotl
rotr
abs
max
min
2017-12-15 17:23:04 +01:00
ceil
floor
copysign
2017-12-04 16:26:34 +01:00
nearest
2017-12-15 17:23:04 +01:00
reinterpret
2017-12-04 16:26:34 +01:00
sqrt
trunc
2017-12-04 22:47:08 +01:00
load
store
sizeof
2017-12-15 17:23:04 +01:00
select
unreachable
current_memory
grow_memory
2017-12-12 01:35:48 +01:00
parseInt
parseFloat
2017-12-15 17:23:04 +01:00
changetype
assert
2017-12-15 15:00:19 +01:00
i8
i16
i32
i64
u8
u16
u32
u64
bool
f32
f64
isize
usize
2017-12-16 02:27:39 +01:00
HEAP_START
2017-12-04 19:26:50 +01:00
logical/i
logical/I
logical/f
logical/F
2017-12-04 16:26:34 +01:00
[program.exports]
;)