Skip to content

Update Binaryen with WebAssembly/binaryen#2336 #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@protobufjs/utf8": "^1.1.0",
"binaryen": "89.0.0-nightly.20190909",
"binaryen": "89.0.0-nightly.20190914",
"glob": "^7.1.4",
"long": "^4.0.0",
"opencollective-postinstall": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/glue/binaryen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ declare function _BinaryenNotVec128(): BinaryenSIMDOp;
declare function _BinaryenAndVec128(): BinaryenSIMDOp;
declare function _BinaryenOrVec128(): BinaryenSIMDOp;
declare function _BinaryenXorVec128(): BinaryenSIMDOp;
declare function _BinaryenBitselectVec128(): BinaryenSIMDOp;
declare function _BinaryenNegVecI8x16(): BinaryenSIMDOp;
declare function _BinaryenAnyTrueVecI8x16(): BinaryenSIMDOp;
declare function _BinaryenAllTrueVecI8x16(): BinaryenSIMDOp;
Expand Down Expand Up @@ -395,7 +396,6 @@ declare function _BinaryenConvertSVecI32x4ToVecF32x4(): BinaryenSIMDOp;
declare function _BinaryenConvertUVecI32x4ToVecF32x4(): BinaryenSIMDOp;
declare function _BinaryenConvertSVecI64x2ToVecF64x2(): BinaryenSIMDOp;
declare function _BinaryenConvertUVecI64x2ToVecF64x2(): BinaryenSIMDOp;
declare function _BinaryenBitselect(): BinaryenSIMDOp;

declare type BinaryenExpressionRef = usize;

Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export enum SIMDShiftOp {
}

export enum SIMDTernaryOp {
Bitselect = 0, // FIXME: _BinaryenBitselect(), requires https://github.com/WebAssembly/binaryen/pull/2336
Bitselect = _BinaryenBitselectVec128(),
QFMAF32x4 = _BinaryenQFMAVecF32x4(),
QFMSF32x4 = _BinaryenQFMSVecF32x4(),
QFMAF64x2 = _BinaryenQFMAVecF64x2(),
Expand Down
17 changes: 3 additions & 14 deletions tests/compiler/abi.optimized.wat
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
(module
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
(global $abi/condition (mut i32) (i32.const 0))
Expand All @@ -12,25 +10,16 @@
(export "exportedExported" (func $abi/exported))
(export "exportedInternal" (func $abi/exported))
(start $start)
(func $abi/exported (; 1 ;) (type $FUNCSIG$i) (result i32)
(func $abi/exported (; 0 ;) (type $FUNCSIG$i) (result i32)
i32.const -128
)
(func $start (; 2 ;) (type $FUNCSIG$v)
(func $start (; 1 ;) (type $FUNCSIG$v)
i32.const 1
global.set $abi/condition
i32.const 0
global.set $abi/y
global.get $abi/y
if
i32.const 0
i32.const 24
i32.const 65
i32.const 2
call $~lib/builtins/abort
unreachable
end
)
(func $null (; 3 ;) (type $FUNCSIG$v)
(func $null (; 2 ;) (type $FUNCSIG$v)
nop
)
)
100 changes: 4 additions & 96 deletions tests/compiler/bool.optimized.wat
Original file line number Diff line number Diff line change
@@ -1,108 +1,16 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $start:bool (; 1 ;) (type $FUNCSIG$v)
i32.const 2
i32.const 0
i32.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 2
i32.const 0
call $~lib/builtins/abort
unreachable
end
i64.const 2
i64.const 0
i64.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 4
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 2
i32.const 0
i32.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 6
i32.const 0
call $~lib/builtins/abort
unreachable
end
i64.const 2
i64.const 0
i64.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 8
i32.const 0
call $~lib/builtins/abort
unreachable
end
f32.const 2
f32.const 0
f32.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 10
i32.const 0
call $~lib/builtins/abort
unreachable
end
f64.const 2
f64.const 0
f64.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 12
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 2
i32.const 0
i32.ne
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 14
i32.const 0
call $~lib/builtins/abort
unreachable
end
(func $start:bool (; 0 ;) (type $FUNCSIG$v)
nop
)
(func $start (; 2 ;) (type $FUNCSIG$v)
(func $start (; 1 ;) (type $FUNCSIG$v)
call $start:bool
)
(func $null (; 3 ;) (type $FUNCSIG$v)
(func $null (; 2 ;) (type $FUNCSIG$v)
nop
)
)
60 changes: 0 additions & 60 deletions tests/compiler/builtins.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -166,43 +166,10 @@
global.set $builtins/i
i32.const 42
global.set $builtins/i
global.get $builtins/i
i32.const 42
i32.ne
if
i32.const 0
i32.const 64
i32.const 67
i32.const 19
call $~lib/builtins/abort
unreachable
end
i32.const 2
global.set $builtins/i
global.get $builtins/i
i32.const 2
i32.ne
if
i32.const 0
i32.const 64
i32.const 68
i32.const 20
call $~lib/builtins/abort
unreachable
end
i32.const 1
global.set $builtins/i
global.get $builtins/i
i32.const 1
i32.ne
if
i32.const 0
i32.const 64
i32.const 69
i32.const 20
call $~lib/builtins/abort
unreachable
end
i64.const 63
global.set $builtins/I
i64.const 0
Expand All @@ -215,30 +182,8 @@
global.set $builtins/I
i64.const 42
global.set $builtins/I
global.get $builtins/I
i64.const 42
i64.ne
if
i32.const 0
i32.const 64
i32.const 85
i32.const 19
call $~lib/builtins/abort
unreachable
end
i64.const 2
global.set $builtins/I
global.get $builtins/I
i64.const 2
i64.ne
if
i32.const 0
i32.const 64
i32.const 86
i32.const 20
call $~lib/builtins/abort
unreachable
end
i64.const 1
global.set $builtins/I
global.get $builtins/i
Expand Down Expand Up @@ -626,11 +571,6 @@
global.set $builtins/f
f64.const 25
global.set $builtins/F
global.get $builtins/i
i32.eqz
if
unreachable
end
i32.const 1
i32.const 2
call $start:builtins~anonymous|0
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/call-super.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
(func $start (; 14 ;) (type $FUNCSIG$v)
i32.const 64
global.set $~lib/rt/stub/startOffset
global.get $~lib/rt/stub/startOffset
i32.const 64
global.set $~lib/rt/stub/offset
call $call-super/test1
call $call-super/test2
Expand Down
13 changes: 5 additions & 8 deletions tests/compiler/comma.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@
end
i32.const 0
global.set $comma/b
global.get $comma/b
i32.const 0
global.set $comma/a
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
global.set $comma/b
Expand Down Expand Up @@ -130,11 +128,10 @@
i32.const 0
local.set $0
loop $loop|0
block $break|0
local.get $0
global.get $comma/a
i32.ge_s
br_if $break|0
local.get $0
global.get $comma/a
i32.lt_s
if
global.get $comma/a
i32.const 1
i32.sub
Expand Down
30 changes: 8 additions & 22 deletions tests/compiler/constructor.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
(local $0 i32)
i32.const 16
global.set $~lib/rt/stub/startOffset
global.get $~lib/rt/stub/startOffset
i32.const 16
global.set $~lib/rt/stub/offset
i32.const 0
i32.const 3
Expand Down Expand Up @@ -152,37 +152,23 @@
global.set $constructor/justFieldNoInit
i32.const 0
global.set $constructor/ctorReturns
i32.const 1
if (result i32)
i32.const 0
else
i32.const 0
i32.const 10
call $~lib/rt/stub/__alloc
end
i32.const 0
global.set $constructor/ctorConditionallyReturns
i32.const 0
i32.const 11
call $~lib/rt/stub/__alloc
global.set $constructor/ctorAllocates
i32.const 0
local.set $0
i32.const 1
if
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
i32.eqz
if
i32.const 12
call $~lib/rt/stub/__alloc
local.tee $0
if (result i32)
local.get $0
else
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
global.set $constructor/ctorConditionallyAllocates
)
(func $start (; 3 ;) (type $FUNCSIG$v)
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/exports.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
(func $start (; 8 ;) (type $FUNCSIG$v)
i32.const 16
global.set $~lib/rt/stub/startOffset
global.get $~lib/rt/stub/startOffset
i32.const 16
global.set $~lib/rt/stub/offset
)
(func $null (; 9 ;) (type $FUNCSIG$v)
Expand Down
Loading