sizeof, load and store builtins

This commit is contained in:
dcodeIO
2017-12-04 02:00:48 +01:00
parent 017efc71b6
commit 63a67e7c67
17 changed files with 214 additions and 44 deletions

View File

@ -838,6 +838,9 @@
isNaN
isFinite
assert
sizeof
load
store
binary/b
binary/i
binary/I

View File

@ -104,3 +104,20 @@ s = grow_memory(1);
if (0) unreachable();
assert(true);
sizeof<u8>();
sizeof<u16>();
sizeof<u32>();
sizeof<u64>();
sizeof<usize>();
sizeof<bool>();
sizeof<i8>();
sizeof<i16>();
sizeof<i32>();
sizeof<i64>();
sizeof<isize>();
sizeof<f32>();
sizeof<f64>();
i = load<i32>(4);
store<i32>(4, i);

View File

@ -475,6 +475,54 @@
)
(unreachable)
)
(drop
(i32.const 1)
)
(drop
(i32.const 2)
)
(drop
(i32.const 4)
)
(drop
(i32.const 8)
)
(drop
(i32.const 4)
)
(drop
(i32.const 1)
)
(drop
(i32.const 1)
)
(drop
(i32.const 2)
)
(drop
(i32.const 4)
)
(drop
(i32.const 8)
)
(drop
(i32.const 4)
)
(drop
(i32.const 4)
)
(drop
(i32.const 8)
)
(set_global $builtins/i
(i32.load
(i32.const 4)
)
)
(i32.store
(i32.const 4)
(get_global $builtins/i)
)
)
)
(;
@ -499,6 +547,9 @@
isNaN
isFinite
assert
sizeof
load
store
builtins/b
builtins/i
builtins/I

View File

@ -77,6 +77,9 @@
isNaN
isFinite
assert
sizeof
load
store
do/loopDo
do/loopDoInDo
[program.exports]

View File

@ -46,6 +46,9 @@
isNaN
isFinite
assert
sizeof
load
store
export/add
export/sub
export/a

View File

@ -68,6 +68,9 @@
isNaN
isFinite
assert
sizeof
load
store
if/ifThenElse
if/ifThen
if/ifThenElseBlock

View File

@ -60,6 +60,9 @@
isNaN
isFinite
assert
sizeof
load
store
export/add
export/sub
export/a

View File

@ -161,6 +161,9 @@
isNaN
isFinite
assert
sizeof
load
store
[program.exports]
;)

View File

@ -62,6 +62,9 @@
isNaN
isFinite
assert
sizeof
load
store
export/add
export/sub
export/a

View File

@ -167,6 +167,9 @@
isNaN
isFinite
assert
sizeof
load
store
switch/doSwitch
switch/doSwitchDefaultFirst
switch/doSwitchDefaultOmitted

View File

@ -655,6 +655,9 @@
isNaN
isFinite
assert
sizeof
load
store
unary/i
unary/I
unary/f

View File

@ -86,6 +86,9 @@
isNaN
isFinite
assert
sizeof
load
store
while/loopWhile
while/loopWhileInWhile
[program.exports]