summaryrefslogtreecommitdiff
path: root/test/binaryen.js/simd.js
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2019-03-13 16:58:45 +0100
committerAlon Zakai <alonzakai@gmail.com>2019-03-13 08:58:45 -0700
commit65446aeade5b5a1acab6ae2a605ae1702251fda2 (patch)
tree5f6fe5423bfa98248f2d64b21ea9b142ce2bd45c /test/binaryen.js/simd.js
parentf0ec4b02fb797387040c65d63f690b3856b1183e (diff)
downloadbinaryen-65446aeade5b5a1acab6ae2a605ae1702251fda2.tar.gz
binaryen-65446aeade5b5a1acab6ae2a605ae1702251fda2.tar.bz2
binaryen-65446aeade5b5a1acab6ae2a605ae1702251fda2.zip
Add BinaryenConstGetValueV128 to C/JS-API (#1931)
This PR adds void BinaryenConstGetValueV128(BinaryenExpressionRef expr, uint8_t* out); to the C-API and uses it in Binaryen.getExpressionInfo in the JS-API.
Diffstat (limited to 'test/binaryen.js/simd.js')
-rw-r--r--test/binaryen.js/simd.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/binaryen.js/simd.js b/test/binaryen.js/simd.js
new file mode 100644
index 000000000..a6055a267
--- /dev/null
+++ b/test/binaryen.js/simd.js
@@ -0,0 +1,5 @@
+var module = new Binaryen.Module();
+
+var expr = module.v128.const([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0]);
+var info = Binaryen.getExpressionInfo(expr);
+console.log("v128.const i8x16 0x" + info.value.map(b => b.toString(16)).join(" 0x"));