<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209306] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209306">209306</a></dd>
<dt>Author</dt> <dd>jfbastien@apple.com</dd>
<dt>Date</dt> <dd>2016-12-03 14:58:26 -0800 (Sat, 03 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>WebAssembly: update binary format to 0xD version
https://bugs.webkit.org/show_bug.cgi?id=165345
Reviewed by Keith Miller.
As described in the following PR: https://github.com/WebAssembly/design/pull/836
Originally committed in <a href="http://trac.webkit.org/projects/webkit/changeset/209175">r209175</a>, reverted in <a href="http://trac.webkit.org/projects/webkit/changeset/209242">r209242</a>, and fixed in <a href="http://trac.webkit.org/projects/webkit/changeset/209284">r209284</a>.
JSTests:
* wasm/Builder.js:
(const._normalizeFunctionSignature):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Type):
(const.emitters.Code):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.block_type):
(export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
* wasm/WASM.js:
* wasm/js-api/test_basic_api.js:
* wasm/self-test/test_BuilderWebAssembly.js:
(EmptyModule):
(CustomSection):
* wasm/self-test/test_WASM.js:
* wasm/wasm.json:
Source/JavaScriptCore:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::zeroForType):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::createJSWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::marshallArgument):
* wasm/WasmFormat.cpp:
(JSC::Wasm::toString): Deleted.
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
(JSC::Wasm::toB3Type): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
(JSC::Wasm::ModuleParser::parseType):
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseResultType):
* wasm/generateWasm.py:
(Wasm.__init__):
* wasm/generateWasmOpsHeader.py:
(cppMacro):
(typeMacroizer):
(opcodeMacroizer):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/wasm.json:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkJSTestswasmBuilderjs">trunk/JSTests/wasm/Builder.js</a></li>
<li><a href="#trunkJSTestswasmBuilder_WebAssemblyBinaryjs">trunk/JSTests/wasm/Builder_WebAssemblyBinary.js</a></li>
<li><a href="#trunkJSTestswasmLowLevelBinaryjs">trunk/JSTests/wasm/LowLevelBinary.js</a></li>
<li><a href="#trunkJSTestswasmWASMjs">trunk/JSTests/wasm/WASM.js</a></li>
<li><a href="#trunkJSTestswasmjsapitest_basic_apijs">trunk/JSTests/wasm/js-api/test_basic_api.js</a></li>
<li><a href="#trunkJSTestswasmselftesttest_BuilderWebAssemblyjs">trunk/JSTests/wasm/self-test/test_BuilderWebAssembly.js</a></li>
<li><a href="#trunkJSTestswasmselftesttest_WASMjs">trunk/JSTests/wasm/self-test/test_WASM.js</a></li>
<li><a href="#trunkJSTestswasmwasmjson">trunk/JSTests/wasm/wasm.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp">trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmCallingConventionh">trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFormatcpp">trunk/Source/JavaScriptCore/wasm/WasmFormat.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFormath">trunk/Source/JavaScriptCore/wasm/WasmFormat.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFunctionParserh">trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmModuleParsercpp">trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmModuleParserh">trunk/Source/JavaScriptCore/wasm/WasmModuleParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmParserh">trunk/Source/JavaScriptCore/wasm/WasmParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmgenerateWasmpy">trunk/Source/JavaScriptCore/wasm/generateWasm.py</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmgenerateWasmOpsHeaderpy">trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmwasmjson">trunk/Source/JavaScriptCore/wasm/wasm.json</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/ChangeLog        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-12-03 JF Bastien <jfbastien@apple.com>
+
+ WebAssembly: update binary format to 0xD version
+ https://bugs.webkit.org/show_bug.cgi?id=165345
+
+ Reviewed by Keith Miller.
+
+ As described in the following PR: https://github.com/WebAssembly/design/pull/836
+ Originally committed in r209175, reverted in r209242, and fixed in r209284.
+
+ * wasm/Builder.js:
+ (const._normalizeFunctionSignature):
+ * wasm/Builder_WebAssemblyBinary.js:
+ (const.emitters.Type):
+ (const.emitters.Code):
+ * wasm/LowLevelBinary.js:
+ (export.default.LowLevelBinary.prototype.block_type):
+ (export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
+ * wasm/WASM.js:
+ * wasm/js-api/test_basic_api.js:
+ * wasm/self-test/test_BuilderWebAssembly.js:
+ (EmptyModule):
+ (CustomSection):
+ * wasm/self-test/test_WASM.js:
+ * wasm/wasm.json:
+
</ins><span class="cx"> 2016-12-02 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> Add Wasm copysign
</span></span></pre></div>
<a id="trunkJSTestswasmBuilderjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/Builder.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/Builder.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/Builder.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> if (typeof(ret) === "undefined")
</span><span class="cx"> ret = "void";
</span><span class="cx"> assert.isNotArray(ret, `Multiple return values not supported by WebAssembly yet`);
</span><del>- assert.falsy(ret !== "void" && !WASM.isValidValueType(ret), `Type return ${ret} must be valid value type`);
</del><ins>+ assert.truthy(WASM.isValidBlockType(ret), `Type return ${ret} must be valid block type`);
</ins><span class="cx"> return [params, ret];
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">
</span><span class="cx"> const _checkStackArgs = (op, param) => {
</span><span class="cx"> for (let expect of param) {
</span><del>- if (WASM.isValidValueType(expect)) {
</del><ins>+ if (WASM.isValidType(expect)) {
</ins><span class="cx"> // FIXME implement stack checks for arguments. https://bugs.webkit.org/show_bug.cgi?id=163421
</span><span class="cx"> } else {
</span><span class="cx"> // Handle our own meta-types.
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">
</span><span class="cx"> const _checkStackReturn = (op, ret) => {
</span><span class="cx"> for (let expect of ret) {
</span><del>- if (WASM.isValidValueType(expect)) {
</del><ins>+ if (WASM.isValidType(expect)) {
</ins><span class="cx"> // FIXME implement stack checks for return. https://bugs.webkit.org/show_bug.cgi?id=163421
</span><span class="cx"> } else {
</span><span class="cx"> // Handle our own meta-types.
</span><span class="lines">@@ -221,8 +221,7 @@
</span><span class="cx"> case "default_target": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
</span><span class="cx"> case "relative_depth": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
</span><span class="cx"> case "sig":
</span><del>- // FIXME this should be isValidBlockType https://bugs.webkit.org/show_bug.cgi?id=164724
- assert.truthy(imms[idx] === "void" || WASM.isValidValueType(imms[idx]), `Invalid block type on ${op}: "${imms[idx]}"`);
</del><ins>+ assert.truthy(WASM.isValidBlockType(imms[idx]), `Invalid block type on ${op}: "${imms[idx]}"`);
</ins><span class="cx"> break;
</span><span class="cx"> case "target_count": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
</span><span class="cx"> case "target_table": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
</span></span></pre></div>
<a id="trunkJSTestswasmBuilder_WebAssemblyBinaryjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/Builder_WebAssemblyBinary.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/Builder_WebAssemblyBinary.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/Builder_WebAssemblyBinary.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -33,16 +33,15 @@
</span><span class="cx"> Type: (section, bin) => {
</span><span class="cx"> put(bin, "varuint32", section.data.length);
</span><span class="cx"> for (const entry of section.data) {
</span><del>- const funcTypeConstructor = -0x20; // FIXME Move this to wasm.json.
- put(bin, "varint7", funcTypeConstructor);
</del><ins>+ put(bin, "varint7", WASM.typeValue["func"]);
</ins><span class="cx"> put(bin, "varuint32", entry.params.length);
</span><span class="cx"> for (const param of entry.params)
</span><del>- put(bin, "uint8", WASM.valueTypeValue[param]);
</del><ins>+ put(bin, "varint7", WASM.typeValue[param]);
</ins><span class="cx"> if (entry.ret === "void")
</span><span class="cx"> put(bin, "varuint1", 0);
</span><span class="cx"> else {
</span><span class="cx"> put(bin, "varuint1", 1);
</span><del>- put(bin, "uint8", WASM.valueTypeValue[entry.ret]);
</del><ins>+ put(bin, "varint7", WASM.typeValue[entry.ret]);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="lines">@@ -107,7 +106,7 @@
</span><span class="cx"> put(funcBin, "varuint32", localCount);
</span><span class="cx"> for (let i = func.parameterCount; i < func.locals.length; ++i) {
</span><span class="cx"> put(funcBin, "varuint32", 1);
</span><del>- put(funcBin, "uint8", WASM.valueTypeValue[func.locals[i]]);
</del><ins>+ put(funcBin, "varint7", WASM.typeValue[func.locals[i]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (const op of func.code) {
</span></span></pre></div>
<a id="trunkJSTestswasmLowLevelBinaryjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/LowLevelBinary.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/LowLevelBinary.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/LowLevelBinary.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -159,8 +159,10 @@
</span><span class="cx"> throw new RangeError(`Invalid varuint7 ${v} range is [${varuint32Min}, ${varuint7Max}]`);
</span><span class="cx"> this.varuint32(v);
</span><span class="cx"> }
</span><del>- inline_signature_type(v) {
- this.varint7(WASM.valueTypeValue[v]);
</del><ins>+ block_type(v) {
+ if (!WASM.isValidBlockType(v))
+ throw new Error(`Invalid block type ${v}`);
+ this.varint7(WASM.typeValue[v]);
</ins><span class="cx"> }
</span><span class="cx"> string(str) {
</span><span class="cx"> let patch = this.newPatchable("varuint32");
</span></span></pre></div>
<a id="trunkJSTestswasmWASMjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/WASM.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/WASM.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/WASM.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -33,10 +33,14 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> export const description = utilities.json("wasm.json");
</span><del>-export const valueType = Object.keys(description.value_type);
-const _valueTypeSet = new Set(valueType);
</del><ins>+export const type = Object.keys(description.type);
+const _typeSet = new Set(type);
+export const isValidType = v => _typeSet.has(v);
+export const typeValue = _mapValues(description.type);
+const _valueTypeSet = new Set(description.value_type);
</ins><span class="cx"> export const isValidValueType = v => _valueTypeSet.has(v);
</span><del>-export const valueTypeValue = _mapValues(description.value_type);
</del><ins>+const _blockTypeSet = new Set(description.block_type);
+export const isValidBlockType = v => _blockTypeSet.has(v);
</ins><span class="cx"> export const externalKindValue = _mapValues(description.external_kind);
</span><span class="cx"> export const sections = Object.keys(description.section);
</span><span class="cx"> export const sectionEncodingType = description.section[sections[0]].type;
</span></span></pre></div>
<a id="trunkJSTestswasmjsapitest_basic_apijs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/test_basic_api.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/test_basic_api.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/js-api/test_basic_api.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> import * as assert from '../assert.js';
</span><span class="cx"> import * as utilities from '../utilities.js';
</span><span class="cx">
</span><del>-const version = 0xC;
</del><ins>+const version = 0x0D;
</ins><span class="cx"> const emptyModuleArray = Uint8Array.of(0x0, 0x61, 0x73, 0x6d, version, 0x00, 0x00, 0x00);
</span><span class="cx"> const invalidConstructorInputs = [undefined, null, "", 1, {}, []];
</span><span class="cx"> const invalidInstanceImports = [null, "", 1];
</span></span></pre></div>
<a id="trunkJSTestswasmselftesttest_BuilderWebAssemblyjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/self-test/test_BuilderWebAssembly.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/self-test/test_BuilderWebAssembly.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/self-test/test_BuilderWebAssembly.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> const bin = builder.WebAssembly();
</span><span class="cx"> // Note: this will change as we update version number.
</span><span class="cx"> assert.eq(bin.hexdump().trim(),
</span><del>- "00000000 00 61 73 6d 0c 00 00 00 |·asm···· |");
</del><ins>+ "00000000 00 61 73 6d 0d 00 00 00 |·asm···· |");
</ins><span class="cx"> })();
</span><span class="cx">
</span><span class="cx"> (function EmptyModule() {
</span><span class="lines">@@ -27,6 +27,6 @@
</span><span class="cx"> .End()
</span><span class="cx"> .WebAssembly();
</span><span class="cx"> assert.eq(bin.hexdump().trim(),
</span><del>- ["00000000 00 61 73 6d 0c 00 00 00 00 0a 05 4f 48 48 41 49 |·asm·······OHHAI|",
</del><ins>+ ["00000000 00 61 73 6d 0d 00 00 00 00 0a 05 4f 48 48 41 49 |·asm·······OHHAI|",
</ins><span class="cx"> "00000010 de ad c0 fe |···· |"].join("\n"));
</span><span class="cx"> })();
</span></span></pre></div>
<a id="trunkJSTestswasmselftesttest_WASMjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/self-test/test_WASM.js (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/self-test/test_WASM.js        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/self-test/test_WASM.js        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -2,17 +2,16 @@
</span><span class="cx"> import * as WASM from '../WASM.js';
</span><span class="cx">
</span><span class="cx"> assert.isNotUndef(WASM.description);
</span><del>-assert.isNotUndef(WASM.valueType);
-assert.ge(WASM.valueType.length, 4);
</del><ins>+assert.isNotUndef(WASM.type);
+assert.ge(WASM.type.length, 7);
</ins><span class="cx">
</span><del>-for (const v of WASM.valueType)
- if (!WASM.isValidValueType(v))
- throw new Error(`Expected value ${v} to be a valid value type`);
</del><ins>+for (const v of WASM.type)
+ if (!WASM.isValidType(v))
+ throw new Error(`Expected value ${v} to be a valid type`);
</ins><span class="cx">
</span><span class="cx"> const expectedFields = [
</span><span class="cx"> "preamble",
</span><del>- "value_type",
- "inline_signature_type",
</del><ins>+ "type",
</ins><span class="cx"> "external_kind",
</span><span class="cx"> "section",
</span><span class="cx"> "opcode",
</span></span></pre></div>
<a id="trunkJSTestswasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/wasm.json (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/wasm.json        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/JSTests/wasm/wasm.json        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -1,25 +1,23 @@
</span><span class="cx"> {
</span><span class="cx"> "comments": ["This file describes the WebAssembly ISA.",
</span><del>- "Scripts in this folder auto-generate C++ code for JavaScriptCore as well as the testing DSL which WebKit's WebAssembly tests use.",
- "When you update this file you need to re-generate the C++ code: jsc ./JSTests/stress/wasm/generate-wasmops-header.js > ./Source/JavaScriptCore/wasm/WASMOps.h"
</del><ins>+ "Scripts in this folder auto-generate C++ code for JavaScriptCore as well as the testing DSL which WebKit's WebAssembly tests use."
</ins><span class="cx"> ],
</span><span class="cx"> "preamble": [
</span><span class="cx"> { "name": "magic number", "type": "uint32", "value": 1836278016, "description": "NULL character followed by 'asm'" },
</span><del>- { "name": "version", "type": "uint32", "value": 12, "description": "Version number, will be reset to 1 for MVP" }
</del><ins>+ { "name": "version", "type": "uint32", "value": 13, "description": "Version number, will be reset to 1 for MVP" }
</ins><span class="cx"> ],
</span><del>- "value_type" : {
- "i32": { "type": "uint8", "value": 1 },
- "i64": { "type": "uint8", "value": 2 },
- "f32": { "type": "uint8", "value": 3 },
- "f64": { "type": "uint8", "value": 4 }
</del><ins>+ "type" : {
+ "i32": { "type": "varint7", "value": -1, "b3type": "B3::Int32" },
+ "i64": { "type": "varint7", "value": -2, "b3type": "B3::Int64" },
+ "f32": { "type": "varint7", "value": -3, "b3type": "B3::Float" },
+ "f64": { "type": "varint7", "value": -4, "b3type": "B3::Double" },
+ "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Void" },
+ "func": { "type": "varint7", "value": -32, "b3type": "B3::Void" },
+ "void": { "type": "varint7", "value": -64, "b3type": "B3::Void" }
</ins><span class="cx"> },
</span><del>- "inline_signature_type" : {
- "void": { "type": "uint8", "value": 0 },
- "i32": { "type": "uint8", "value": 1 },
- "i64": { "type": "uint8", "value": 2 },
- "f32": { "type": "uint8", "value": 3 },
- "f64": { "type": "uint8", "value": 4 }
- },
</del><ins>+ "value_type": ["i32", "i64", "f32", "f64"],
+ "block_type": ["i32", "i64", "f32", "f64", "void"],
+ "elem_type": ["anyfunc"],
</ins><span class="cx"> "external_kind": {
</span><span class="cx"> "Function": { "type": "uint8", "value": 0 },
</span><span class="cx"> "Table": { "type": "uint8", "value": 1 },
</span><span class="lines">@@ -41,179 +39,179 @@
</span><span class="cx"> },
</span><span class="cx"> "opcode": {
</span><span class="cx"> "unreachable": { "category": "control", "value": 0, "return": [], "parameter": [], "immediate": [], "description": "trap immediately" },
</span><del>- "block": { "category": "control", "value": 1, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a sequence of expressions, yielding 0 or 1 values" },
- "loop": { "category": "control", "value": 2, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a block which can also form control flow loops" },
- "if": { "category": "control", "value": 3, "return": ["control"], "parameter": ["bool"], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin if expression" },
- "else": { "category": "control", "value": 4, "return": ["control"], "parameter": [], "immediate": [], "description": "begin else expression of if" },
- "select": { "category": "control", "value": 5, "return": ["prev"], "parameter": ["any", "prev", "bool"], "immediate": [], "description": "select one of two values based on condition" },
- "br": { "category": "control", "value": 6, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "break that targets an outer nested block" },
- "br_if": { "category": "control", "value": 7, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "conditional break that targets an outer nested block" },
- "br_table": { "category": "control", "value": 8, "return": [], "parameter": [], "immediate": [{"name": "target_count", "type": "varuint32", "description": "number of entries in the target_table"},
</del><ins>+ "block": { "category": "control", "value": 2, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin a sequence of expressions, yielding 0 or 1 values" },
+ "loop": { "category": "control", "value": 3, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin a block which can also form control flow loops" },
+ "if": { "category": "control", "value": 4, "return": ["control"], "parameter": ["bool"], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin if expression" },
+ "else": { "category": "control", "value": 5, "return": ["control"], "parameter": [], "immediate": [], "description": "begin else expression of if" },
+ "select": { "category": "control", "value": 27, "return": ["prev"], "parameter": ["any", "prev", "bool"], "immediate": [], "description": "select one of two values based on condition" },
+ "br": { "category": "control", "value": 12, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "break that targets an outer nested block" },
+ "br_if": { "category": "control", "value": 13, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "conditional break that targets an outer nested block" },
+ "br_table": { "category": "control", "value": 14, "return": [], "parameter": [], "immediate": [{"name": "target_count", "type": "varuint32", "description": "number of entries in the target_table"},
</ins><span class="cx"> {"name": "target_table", "type": "varuint32*", "description": "target entries that indicate an outer block or loop to which to break"},
</span><span class="cx"> {"name": "default_target", "type": "varuint32", "description": "an outer block or loop to which to break in the default case"}],
</span><span class="cx"> "description": "branch table control flow construct" },
</span><del>- "return": { "category": "control", "value": 9, "return": [], "parameter": [], "immediate": [], "description": "return zero or one value from this function" },
- "drop": { "category": "control", "value": 11, "return": [], "parameter": ["any"], "immediate": [], "description": "ignore value" },
- "nop": { "category": "control", "value": 10, "return": [], "parameter": [], "immediate": [], "description": "no operation" },
- "end": { "category": "control", "value": 15, "return": [], "parameter": [], "immediate": [], "description": "end a block, loop, or if" },
- "i32.const": { "category": "special", "value": 16, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
- "i64.const": { "category": "special", "value": 17, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
- "f64.const": { "category": "special", "value": 18, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "uint64"}], "description": "a constant value interpreted as f64" },
- "f32.const": { "category": "special", "value": 19, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "uint32"}], "description": "a constant value interpreted as f32" },
- "get_local": { "category": "special", "value": 20, "return": ["local"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
- "set_local": { "category": "special", "value": 21, "return": [], "parameter": ["local"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
- "tee_local": { "category": "special", "value": 25, "return": ["prev"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
- "get_global": { "category": "special", "value": 187, "return": ["global"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
- "set_global": { "category": "special", "value": 188, "return": [""], "parameter": ["global"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "write a global variable" },
- "call": { "category": "call", "value": 22, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" },
- "call_indirect": { "category": "call", "value": 23, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}], "description": "call a function indirect with an expected signature" },
- "i32.load8_s": { "category": "memory", "value": 32, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load8_u": { "category": "memory", "value": 33, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load16_s": { "category": "memory", "value": 34, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load16_u": { "category": "memory", "value": 35, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load8_s": { "category": "memory", "value": 36, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load8_u": { "category": "memory", "value": 37, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load16_s": { "category": "memory", "value": 38, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load16_u": { "category": "memory", "value": 39, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load32_s": { "category": "memory", "value": 40, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load32_u": { "category": "memory", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load": { "category": "memory", "value": 42, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load": { "category": "memory", "value": 43, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "f32.load": { "category": "memory", "value": 44, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "f64.load": { "category": "memory", "value": 45, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.store8": { "category": "memory", "value": 46, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i32.store16": { "category": "memory", "value": 47, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store8": { "category": "memory", "value": 48, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store16": { "category": "memory", "value": 49, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store32": { "category": "memory", "value": 50, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i32.store": { "category": "memory", "value": 51, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store": { "category": "memory", "value": 52, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "f32.store": { "category": "memory", "value": 53, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "f64.store": { "category": "memory", "value": 54, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "current_memory": { "category": "operation", "value": 59, "return": ["size"], "parameter": [], "immediate": [], "description": "query the size of memory" },
- "grow_memory": { "category": "operation", "value": 57, "return": ["size"], "parameter": ["size"], "immediate": [], "description": "grow the size of memory" },
- "i32.add": { "category": "arithmetic", "value": 64, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Add" },
- "i32.sub": { "category": "arithmetic", "value": 65, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Sub" },
- "i32.mul": { "category": "arithmetic", "value": 66, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mul" },
- "i32.div_s": { "category": "arithmetic", "value": 67, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Div" },
- "i32.div_u": { "category": "arithmetic", "value": 68, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UDiv" },
- "i32.rem_s": { "category": "arithmetic", "value": 69, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mod" },
- "i32.rem_u": { "category": "arithmetic", "value": 70, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UMod" },
- "i32.and": { "category": "arithmetic", "value": 71, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitAnd" },
- "i32.or": { "category": "arithmetic", "value": 72, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitOr" },
- "i32.xor": { "category": "arithmetic", "value": 73, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitXor" },
- "i32.shl": { "category": "arithmetic", "value": 74, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Shl" },
- "i32.shr_u": { "category": "arithmetic", "value": 75, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "SShr" },
- "i32.shr_s": { "category": "arithmetic", "value": 76, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "ZShr" },
- "i32.rotr": { "category": "arithmetic", "value": 182, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotR" },
- "i32.rotl": { "category": "arithmetic", "value": 183, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotL" },
- "i32.eq": { "category": "comparison", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Equal" },
- "i32.ne": { "category": "comparison", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "NotEqual" },
- "i32.lt_s": { "category": "comparison", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessThan" },
- "i32.le_s": { "category": "comparison", "value": 80, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessEqual" },
- "i32.lt_u": { "category": "comparison", "value": 81, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Below" },
- "i32.le_u": { "category": "comparison", "value": 82, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BelowEqual" },
- "i32.gt_s": { "category": "comparison", "value": 83, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterThan" },
- "i32.ge_s": { "category": "comparison", "value": 84, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterEqual" },
- "i32.gt_u": { "category": "comparison", "value": 85, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Above" },
- "i32.ge_u": { "category": "comparison", "value": 86, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "AboveEqual" },
- "i32.clz": { "category": "arithmetic", "value": 87, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "Clz" },
- "i32.ctz": { "category": "arithmetic", "value": 88, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
- "i32.popcnt": { "category": "arithmetic", "value": 89, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
- "i32.eqz": { "category": "comparison", "value": 90, "return": ["bool"], "parameter": ["i32"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
- "i64.add": { "category": "arithmetic", "value": 91, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Add" },
- "i64.sub": { "category": "arithmetic", "value": 92, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Sub" },
- "i64.mul": { "category": "arithmetic", "value": 93, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mul" },
- "i64.div_s": { "category": "arithmetic", "value": 94, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Div" },
- "i64.div_u": { "category": "arithmetic", "value": 95, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
- "i64.rem_s": { "category": "arithmetic", "value": 96, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mod" },
- "i64.rem_u": { "category": "arithmetic", "value": 97, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
- "i64.and": { "category": "arithmetic", "value": 98, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitAnd" },
- "i64.or": { "category": "arithmetic", "value": 99, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitOr" },
- "i64.xor": { "category": "arithmetic", "value": 100, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitXor" },
- "i64.shl": { "category": "arithmetic", "value": 101, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Shl" },
- "i64.shr_u": { "category": "arithmetic", "value": 102, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "SShr" },
- "i64.shr_s": { "category": "arithmetic", "value": 103, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "ZShr" },
- "i64.rotr": { "category": "arithmetic", "value": 184, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotR" },
- "i64.rotl": { "category": "arithmetic", "value": 185, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotL" },
- "i64.eq": { "category": "comparison", "value": 104, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Equal" },
- "i64.ne": { "category": "comparison", "value": 105, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "NotEqual" },
- "i64.lt_s": { "category": "comparison", "value": 106, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessThan" },
- "i64.le_s": { "category": "comparison", "value": 107, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessEqual" },
- "i64.lt_u": { "category": "comparison", "value": 108, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Below" },
- "i64.le_u": { "category": "comparison", "value": 109, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BelowEqual" },
- "i64.gt_s": { "category": "comparison", "value": 110, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterThan" },
- "i64.ge_s": { "category": "comparison", "value": 111, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterEqual" },
- "i64.gt_u": { "category": "comparison", "value": 112, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Above" },
- "i64.ge_u": { "category": "comparison", "value": 113, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "AboveEqual" },
- "i64.clz": { "category": "arithmetic", "value": 114, "return": ["i64"], "parameter": ["i64"], "immediate": [], "b3op": "Clz" },
- "i64.ctz": { "category": "arithmetic", "value": 115, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
- "i64.popcnt": { "category": "arithmetic", "value": 116, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
- "i64.eqz": { "category": "comparison", "value": 186, "return": ["bool"], "parameter": ["i64"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
- "f32.add": { "category": "arithmetic", "value": 117, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Add" },
- "f32.sub": { "category": "arithmetic", "value": 118, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Sub" },
- "f32.mul": { "category": "arithmetic", "value": 119, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Mul" },
- "f32.div": { "category": "arithmetic", "value": 120, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Div" },
- "f32.min": { "category": "arithmetic", "value": 121, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
- "f32.max": { "category": "arithmetic", "value": 122, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
- "f32.abs": { "category": "arithmetic", "value": 123, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Abs" },
- "f32.neg": { "category": "arithmetic", "value": 124, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Neg" },
- "f32.copysign": { "category": "arithmetic", "value": 125, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i32(0x80000000)), BitAnd(BitwiseCast(@0), i32(0x7fffffff))))" },
- "f32.ceil": { "category": "arithmetic", "value": 126, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Ceil" },
- "f32.floor": { "category": "arithmetic", "value": 127, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Floor" },
- "f32.trunc": { "category": "arithmetic", "value": 128, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
- "f32.nearest": { "category": "arithmetic", "value": 129, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
- "f32.sqrt": { "category": "arithmetic", "value": 130, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Sqrt" },
- "f32.eq": { "category": "comparison", "value": 131, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Equal" },
- "f32.ne": { "category": "comparison", "value": 132, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "NotEqual" },
- "f32.lt": { "category": "comparison", "value": 133, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessThan" },
- "f32.le": { "category": "comparison", "value": 134, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessEqual" },
- "f32.gt": { "category": "comparison", "value": 135, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterThan" },
- "f32.ge": { "category": "comparison", "value": 136, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterEqual" },
- "f64.add": { "category": "arithmetic", "value": 137, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Add" },
- "f64.sub": { "category": "arithmetic", "value": 138, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Sub" },
- "f64.mul": { "category": "arithmetic", "value": 139, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Mul" },
- "f64.div": { "category": "arithmetic", "value": 140, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Div" },
- "f64.min": { "category": "arithmetic", "value": 141, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
- "f64.max": { "category": "arithmetic", "value": 142, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
- "f64.abs": { "category": "arithmetic", "value": 143, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Abs" },
- "f64.neg": { "category": "arithmetic", "value": 144, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Neg" },
- "f64.copysign": { "category": "arithmetic", "value": 145, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i64(0x8000000000000000)), BitAnd(BitwiseCast(@0), i64(0x7fffffffffffffff))))" },
- "f64.ceil": { "category": "arithmetic", "value": 146, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Ceil" },
- "f64.floor": { "category": "arithmetic", "value": 147, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Floor" },
- "f64.trunc": { "category": "arithmetic", "value": 148, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
- "f64.nearest": { "category": "arithmetic", "value": 149, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
- "f64.sqrt": { "category": "arithmetic", "value": 150, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Sqrt" },
- "f64.eq": { "category": "comparison", "value": 151, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Equal" },
- "f64.ne": { "category": "comparison", "value": 152, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "NotEqual" },
- "f64.lt": { "category": "comparison", "value": 153, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessThan" },
- "f64.le": { "category": "comparison", "value": 154, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessEqual" },
- "f64.gt": { "category": "comparison", "value": 155, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterThan" },
- "f64.ge": { "category": "comparison", "value": 156, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterEqual" },
- "i32.trunc_s/f32": { "category": "conversion", "value": 157, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
- "i32.trunc_s/f64": { "category": "conversion", "value": 158, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
- "i32.trunc_u/f32": { "category": "conversion", "value": 159, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
- "i32.trunc_u/f64": { "category": "conversion", "value": 160, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
- "i32.wrap/i64": { "category": "conversion", "value": 161, "return": ["i32"], "parameter": ["i64"], "immediate": [] },
- "i64.trunc_s/f32": { "category": "conversion", "value": 162, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
- "i64.trunc_s/f64": { "category": "conversion", "value": 163, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
- "i64.trunc_u/f32": { "category": "conversion", "value": 164, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
- "i64.trunc_u/f64": { "category": "conversion", "value": 165, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
- "i64.extend_s/i32": { "category": "conversion", "value": 166, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "SExt32" },
- "i64.extend_u/i32": { "category": "conversion", "value": 167, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "ZExt32" },
- "f32.convert_s/i32": { "category": "conversion", "value": 168, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF" },
- "f32.convert_u/i32": { "category": "conversion", "value": 169, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF(ZExt32(@0))" },
- "f32.convert_s/i64": { "category": "conversion", "value": 170, "return": ["f32"], "parameter": ["i64"], "immediate": [], "b3op": "IToF" },
- "f32.convert_u/i64": { "category": "conversion", "value": 171, "return": ["f32"], "parameter": ["i64"], "immediate": [] },
- "f32.demote/f64": { "category": "conversion", "value": 172, "return": ["f32"], "parameter": ["f64"], "immediate": [], "b3op": "DoubleToFloat"},
- "f32.reinterpret/i32": { "category": "conversion", "value": 173, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "BitwiseCast" },
- "f64.convert_s/i32": { "category": "conversion", "value": 174, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD" },
- "f64.convert_u/i32": { "category": "conversion", "value": 175, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD(ZExt32(@0))" },
- "f64.convert_s/i64": { "category": "conversion", "value": 176, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "IToD" },
- "f64.convert_u/i64": { "category": "conversion", "value": 177, "return": ["f64"], "parameter": ["i64"], "immediate": [] },
- "f64.promote/f32": { "category": "conversion", "value": 178, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"},
- "f64.reinterpret/i64": { "category": "conversion", "value": 179, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" },
- "i32.reinterpret/f32": { "category": "conversion", "value": 180, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" },
- "i64.reinterpret/f64": { "category": "conversion", "value": 181, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }
</del><ins>+ "return": { "category": "control", "value": 15, "return": [], "parameter": [], "immediate": [], "description": "return zero or one value from this function" },
+ "drop": { "category": "control", "value": 26, "return": [], "parameter": ["any"], "immediate": [], "description": "ignore value" },
+ "nop": { "category": "control", "value": 1, "return": [], "parameter": [], "immediate": [], "description": "no operation" },
+ "end": { "category": "control", "value": 11, "return": [], "parameter": [], "immediate": [], "description": "end a block, loop, or if" },
+ "i32.const": { "category": "special", "value": 65, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
+ "i64.const": { "category": "special", "value": 66, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
+ "f64.const": { "category": "special", "value": 68, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "uint64"}], "description": "a constant value interpreted as f64" },
+ "f32.const": { "category": "special", "value": 67, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "uint32"}], "description": "a constant value interpreted as f32" },
+ "get_local": { "category": "special", "value": 32, "return": ["local"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
+ "set_local": { "category": "special", "value": 33, "return": [], "parameter": ["local"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
+ "tee_local": { "category": "special", "value": 34, "return": ["prev"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
+ "get_global": { "category": "special", "value": 35, "return": ["global"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
+ "set_global": { "category": "special", "value": 36, "return": [""], "parameter": ["global"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "write a global variable" },
+ "call": { "category": "call", "value": 16, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" },
+ "call_indirect": { "category": "call", "value": 17, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}], "description": "call a function indirect with an expected signature" },
+ "i32.load8_s": { "category": "memory", "value": 44, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load8_u": { "category": "memory", "value": 45, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_s": { "category": "memory", "value": 46, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_u": { "category": "memory", "value": 47, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_s": { "category": "memory", "value": 48, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_u": { "category": "memory", "value": 49, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_s": { "category": "memory", "value": 50, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_u": { "category": "memory", "value": 51, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_s": { "category": "memory", "value": 52, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_u": { "category": "memory", "value": 53, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load": { "category": "memory", "value": 40, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load": { "category": "memory", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f32.load": { "category": "memory", "value": 42, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f64.load": { "category": "memory", "value": 43, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.store8": { "category": "memory", "value": 58, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store16": { "category": "memory", "value": 59, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store8": { "category": "memory", "value": 60, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store16": { "category": "memory", "value": 61, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store32": { "category": "memory", "value": 62, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store": { "category": "memory", "value": 54, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store": { "category": "memory", "value": 55, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f32.store": { "category": "memory", "value": 56, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f64.store": { "category": "memory", "value": 57, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "current_memory": { "category": "operation", "value": 63, "return": ["size"], "parameter": [], "immediate": [], "description": "query the size of memory" },
+ "grow_memory": { "category": "operation", "value": 64, "return": ["size"], "parameter": ["size"], "immediate": [], "description": "grow the size of memory" },
+ "i32.add": { "category": "arithmetic", "value": 106, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Add" },
+ "i32.sub": { "category": "arithmetic", "value": 107, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Sub" },
+ "i32.mul": { "category": "arithmetic", "value": 108, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mul" },
+ "i32.div_s": { "category": "arithmetic", "value": 109, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Div" },
+ "i32.div_u": { "category": "arithmetic", "value": 110, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UDiv" },
+ "i32.rem_s": { "category": "arithmetic", "value": 111, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mod" },
+ "i32.rem_u": { "category": "arithmetic", "value": 112, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UMod" },
+ "i32.and": { "category": "arithmetic", "value": 113, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitAnd" },
+ "i32.or": { "category": "arithmetic", "value": 114, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitOr" },
+ "i32.xor": { "category": "arithmetic", "value": 115, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitXor" },
+ "i32.shl": { "category": "arithmetic", "value": 116, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Shl" },
+ "i32.shr_u": { "category": "arithmetic", "value": 118, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "SShr" },
+ "i32.shr_s": { "category": "arithmetic", "value": 117, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "ZShr" },
+ "i32.rotr": { "category": "arithmetic", "value": 120, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotR" },
+ "i32.rotl": { "category": "arithmetic", "value": 119, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotL" },
+ "i32.eq": { "category": "comparison", "value": 70, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Equal" },
+ "i32.ne": { "category": "comparison", "value": 71, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "NotEqual" },
+ "i32.lt_s": { "category": "comparison", "value": 72, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessThan" },
+ "i32.le_s": { "category": "comparison", "value": 76, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessEqual" },
+ "i32.lt_u": { "category": "comparison", "value": 73, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Below" },
+ "i32.le_u": { "category": "comparison", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BelowEqual" },
+ "i32.gt_s": { "category": "comparison", "value": 74, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterThan" },
+ "i32.ge_s": { "category": "comparison", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterEqual" },
+ "i32.gt_u": { "category": "comparison", "value": 75, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Above" },
+ "i32.ge_u": { "category": "comparison", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "AboveEqual" },
+ "i32.clz": { "category": "arithmetic", "value": 103, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "Clz" },
+ "i32.ctz": { "category": "arithmetic", "value": 104, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
+ "i32.popcnt": { "category": "arithmetic", "value": 105, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
+ "i32.eqz": { "category": "comparison", "value": 69, "return": ["bool"], "parameter": ["i32"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
+ "i64.add": { "category": "arithmetic", "value": 124, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Add" },
+ "i64.sub": { "category": "arithmetic", "value": 125, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Sub" },
+ "i64.mul": { "category": "arithmetic", "value": 126, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mul" },
+ "i64.div_s": { "category": "arithmetic", "value": 127, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Div" },
+ "i64.div_u": { "category": "arithmetic", "value": 128, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
+ "i64.rem_s": { "category": "arithmetic", "value": 129, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mod" },
+ "i64.rem_u": { "category": "arithmetic", "value": 130, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
+ "i64.and": { "category": "arithmetic", "value": 131, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitAnd" },
+ "i64.or": { "category": "arithmetic", "value": 132, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitOr" },
+ "i64.xor": { "category": "arithmetic", "value": 133, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitXor" },
+ "i64.shl": { "category": "arithmetic", "value": 134, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Shl" },
+ "i64.shr_u": { "category": "arithmetic", "value": 136, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "SShr" },
+ "i64.shr_s": { "category": "arithmetic", "value": 135, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "ZShr" },
+ "i64.rotr": { "category": "arithmetic", "value": 138, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotR" },
+ "i64.rotl": { "category": "arithmetic", "value": 137, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotL" },
+ "i64.eq": { "category": "comparison", "value": 81, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Equal" },
+ "i64.ne": { "category": "comparison", "value": 82, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "NotEqual" },
+ "i64.lt_s": { "category": "comparison", "value": 83, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessThan" },
+ "i64.le_s": { "category": "comparison", "value": 87, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessEqual" },
+ "i64.lt_u": { "category": "comparison", "value": 84, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Below" },
+ "i64.le_u": { "category": "comparison", "value": 88, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BelowEqual" },
+ "i64.gt_s": { "category": "comparison", "value": 85, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterThan" },
+ "i64.ge_s": { "category": "comparison", "value": 89, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterEqual" },
+ "i64.gt_u": { "category": "comparison", "value": 86, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Above" },
+ "i64.ge_u": { "category": "comparison", "value": 90, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "AboveEqual" },
+ "i64.clz": { "category": "arithmetic", "value": 121, "return": ["i64"], "parameter": ["i64"], "immediate": [], "b3op": "Clz" },
+ "i64.ctz": { "category": "arithmetic", "value": 122, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
+ "i64.popcnt": { "category": "arithmetic", "value": 123, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
+ "i64.eqz": { "category": "comparison", "value": 80, "return": ["bool"], "parameter": ["i64"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
+ "f32.add": { "category": "arithmetic", "value": 146, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Add" },
+ "f32.sub": { "category": "arithmetic", "value": 147, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Sub" },
+ "f32.mul": { "category": "arithmetic", "value": 148, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Mul" },
+ "f32.div": { "category": "arithmetic", "value": 149, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Div" },
+ "f32.min": { "category": "arithmetic", "value": 150, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
+ "f32.max": { "category": "arithmetic", "value": 151, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
+ "f32.abs": { "category": "arithmetic", "value": 139, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Abs" },
+ "f32.neg": { "category": "arithmetic", "value": 140, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Neg" },
+ "f32.copysign": { "category": "arithmetic", "value": 152, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i32(0x80000000)), BitAnd(BitwiseCast(@0), i32(0x7fffffff))))" },
+ "f32.ceil": { "category": "arithmetic", "value": 141, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Ceil" },
+ "f32.floor": { "category": "arithmetic", "value": 142, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Floor" },
+ "f32.trunc": { "category": "arithmetic", "value": 143, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
+ "f32.nearest": { "category": "arithmetic", "value": 144, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
+ "f32.sqrt": { "category": "arithmetic", "value": 145, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Sqrt" },
+ "f32.eq": { "category": "comparison", "value": 91, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Equal" },
+ "f32.ne": { "category": "comparison", "value": 92, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "NotEqual" },
+ "f32.lt": { "category": "comparison", "value": 93, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessThan" },
+ "f32.le": { "category": "comparison", "value": 95, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessEqual" },
+ "f32.gt": { "category": "comparison", "value": 94, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterThan" },
+ "f32.ge": { "category": "comparison", "value": 96, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterEqual" },
+ "f64.add": { "category": "arithmetic", "value": 160, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Add" },
+ "f64.sub": { "category": "arithmetic", "value": 161, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Sub" },
+ "f64.mul": { "category": "arithmetic", "value": 162, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Mul" },
+ "f64.div": { "category": "arithmetic", "value": 163, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Div" },
+ "f64.min": { "category": "arithmetic", "value": 164, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
+ "f64.max": { "category": "arithmetic", "value": 165, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
+ "f64.abs": { "category": "arithmetic", "value": 153, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Abs" },
+ "f64.neg": { "category": "arithmetic", "value": 154, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Neg" },
+ "f64.copysign": { "category": "arithmetic", "value": 166, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i64(0x8000000000000000)), BitAnd(BitwiseCast(@0), i64(0x7fffffffffffffff))))" },
+ "f64.ceil": { "category": "arithmetic", "value": 155, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Ceil" },
+ "f64.floor": { "category": "arithmetic", "value": 156, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Floor" },
+ "f64.trunc": { "category": "arithmetic", "value": 157, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
+ "f64.nearest": { "category": "arithmetic", "value": 158, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
+ "f64.sqrt": { "category": "arithmetic", "value": 159, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Sqrt" },
+ "f64.eq": { "category": "comparison", "value": 97, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Equal" },
+ "f64.ne": { "category": "comparison", "value": 98, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "NotEqual" },
+ "f64.lt": { "category": "comparison", "value": 99, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessThan" },
+ "f64.le": { "category": "comparison", "value": 101, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessEqual" },
+ "f64.gt": { "category": "comparison", "value": 100, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterThan" },
+ "f64.ge": { "category": "comparison", "value": 102, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterEqual" },
+ "i32.trunc_s/f32": { "category": "conversion", "value": 168, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
+ "i32.trunc_s/f64": { "category": "conversion", "value": 170, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
+ "i32.trunc_u/f32": { "category": "conversion", "value": 169, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
+ "i32.trunc_u/f64": { "category": "conversion", "value": 171, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
+ "i32.wrap/i64": { "category": "conversion", "value": 167, "return": ["i32"], "parameter": ["i64"], "immediate": [] },
+ "i64.trunc_s/f32": { "category": "conversion", "value": 174, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
+ "i64.trunc_s/f64": { "category": "conversion", "value": 176, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
+ "i64.trunc_u/f32": { "category": "conversion", "value": 175, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
+ "i64.trunc_u/f64": { "category": "conversion", "value": 177, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
+ "i64.extend_s/i32": { "category": "conversion", "value": 172, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "SExt32" },
+ "i64.extend_u/i32": { "category": "conversion", "value": 173, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "ZExt32" },
+ "f32.convert_s/i32": { "category": "conversion", "value": 178, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF" },
+ "f32.convert_u/i32": { "category": "conversion", "value": 179, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF(ZExt32(@0))" },
+ "f32.convert_s/i64": { "category": "conversion", "value": 180, "return": ["f32"], "parameter": ["i64"], "immediate": [], "b3op": "IToF" },
+ "f32.convert_u/i64": { "category": "conversion", "value": 181, "return": ["f32"], "parameter": ["i64"], "immediate": [] },
+ "f32.demote/f64": { "category": "conversion", "value": 182, "return": ["f32"], "parameter": ["f64"], "immediate": [], "b3op": "DoubleToFloat"},
+ "f32.reinterpret/i32": { "category": "conversion", "value": 190, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "BitwiseCast" },
+ "f64.convert_s/i32": { "category": "conversion", "value": 183, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD" },
+ "f64.convert_u/i32": { "category": "conversion", "value": 184, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD(ZExt32(@0))" },
+ "f64.convert_s/i64": { "category": "conversion", "value": 185, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "IToD" },
+ "f64.convert_u/i64": { "category": "conversion", "value": 186, "return": ["f64"], "parameter": ["i64"], "immediate": [] },
+ "f64.promote/f32": { "category": "conversion", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"},
+ "f64.reinterpret/i64": { "category": "conversion", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" },
+ "i32.reinterpret/f32": { "category": "conversion", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" },
+ "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }
</ins><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-12-03 JF Bastien <jfbastien@apple.com>
+
+ WebAssembly: update binary format to 0xD version
+ https://bugs.webkit.org/show_bug.cgi?id=165345
+
+ Reviewed by Keith Miller.
+
+ As described in the following PR: https://github.com/WebAssembly/design/pull/836
+ Originally committed in r209175, reverted in r209242, and fixed in r209284.
+
+ * wasm/WasmB3IRGenerator.cpp:
+ (JSC::Wasm::B3IRGenerator::B3IRGenerator):
+ (JSC::Wasm::B3IRGenerator::zeroForType):
+ (JSC::Wasm::B3IRGenerator::addConstant):
+ (JSC::Wasm::createJSWrapper):
+ * wasm/WasmCallingConvention.h:
+ (JSC::Wasm::CallingConvention::marshallArgument):
+ * wasm/WasmFormat.cpp:
+ (JSC::Wasm::toString): Deleted.
+ * wasm/WasmFormat.h:
+ (JSC::Wasm::isValueType):
+ (JSC::Wasm::toB3Type): Deleted.
+ * wasm/WasmFunctionParser.h:
+ (JSC::Wasm::FunctionParser<Context>::parseExpression):
+ * wasm/WasmModuleParser.cpp:
+ (JSC::Wasm::ModuleParser::parse):
+ (JSC::Wasm::ModuleParser::parseType):
+ * wasm/WasmModuleParser.h:
+ * wasm/WasmParser.h:
+ (JSC::Wasm::Parser::parseResultType):
+ * wasm/generateWasm.py:
+ (Wasm.__init__):
+ * wasm/generateWasmOpsHeader.py:
+ (cppMacro):
+ (typeMacroizer):
+ (opcodeMacroizer):
+ * wasm/js/WebAssemblyFunction.cpp:
+ (JSC::callWebAssemblyFunction):
+ * wasm/wasm.json:
+
</ins><span class="cx"> 2016-12-02 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> Add Wasm copysign
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx"> Vector<UnlinkedCall>& m_unlinkedCalls;
</span><span class="cx"> GPRReg m_memoryBaseGPR;
</span><span class="cx"> GPRReg m_memorySizeGPR;
</span><del>- Value* m_zeroValues[Type::LastValueType];
</del><ins>+ Value* m_zeroValues[numTypes];
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> B3IRGenerator::B3IRGenerator(Memory* memory, Procedure& procedure, Vector<UnlinkedCall>& unlinkedCalls)
</span><span class="lines">@@ -196,8 +196,19 @@
</span><span class="cx"> {
</span><span class="cx"> m_currentBlock = m_proc.addBlock();
</span><span class="cx">
</span><del>- for (unsigned i = 0; i < Type::LastValueType; ++i)
- m_zeroValues[i] = m_currentBlock->appendIntConstant(m_proc, Origin(), toB3Type(static_cast<Type>(i + 1)), 0);
</del><ins>+ for (unsigned i = 0; i < numTypes; ++i) {
+ switch (B3::Type b3Type = toB3Type(linearizedToType(i))) {
+ case B3::Int32:
+ case B3::Int64:
+ case B3::Float:
+ case B3::Double:
+ m_zeroValues[i] = m_currentBlock->appendIntConstant(m_proc, Origin(), b3Type, 0);
+ break;
+ case B3::Void:
+ m_zeroValues[i] = nullptr;
+ break;
+ }
+ }
</ins><span class="cx">
</span><span class="cx"> if (m_memory) {
</span><span class="cx"> m_memoryBaseGPR = m_memory->pinnedRegisters().baseMemoryPointer;
</span><span class="lines">@@ -218,7 +229,9 @@
</span><span class="cx"> Value* B3IRGenerator::zeroForType(Type type)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(type != Void);
</span><del>- return m_zeroValues[type - 1];
</del><ins>+ Value* zeroValue = m_zeroValues[linearizeType(type)];
+ ASSERT(zeroValue);
+ return zeroValue;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool B3IRGenerator::addLocal(Type type, uint32_t count)
</span><span class="lines">@@ -441,18 +454,21 @@
</span><span class="cx"> B3IRGenerator::ExpressionType B3IRGenerator::addConstant(Type type, uint64_t value)
</span><span class="cx"> {
</span><span class="cx"> switch (type) {
</span><del>- case Int32:
</del><ins>+ case Wasm::I32:
</ins><span class="cx"> return m_currentBlock->appendNew<Const32Value>(m_proc, Origin(), static_cast<int32_t>(value));
</span><del>- case Int64:
</del><ins>+ case Wasm::I64:
</ins><span class="cx"> return m_currentBlock->appendNew<Const64Value>(m_proc, Origin(), value);
</span><del>- case Float:
</del><ins>+ case Wasm::F32:
</ins><span class="cx"> return m_currentBlock->appendNew<ConstFloatValue>(m_proc, Origin(), bitwise_cast<float>(static_cast<int32_t>(value)));
</span><del>- case Double:
</del><ins>+ case Wasm::F64:
</ins><span class="cx"> return m_currentBlock->appendNew<ConstDoubleValue>(m_proc, Origin(), bitwise_cast<double>(value));
</span><del>- default:
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
</del><ins>+ case Wasm::Void:
+ case Wasm::Func:
+ case Wasm::Anyfunc:
+ break;
</ins><span class="cx"> }
</span><ins>+ RELEASE_ASSERT_NOT_REACHED();
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> B3IRGenerator::ControlData B3IRGenerator::addBlock(Type signature)
</span><span class="lines">@@ -701,17 +717,20 @@
</span><span class="cx">
</span><span class="cx"> // Return the result, if needed.
</span><span class="cx"> switch (signature->returnType) {
</span><del>- case Void:
</del><ins>+ case Wasm::Void:
</ins><span class="cx"> block->appendNewControlValue(proc, B3::Return, Origin());
</span><span class="cx"> break;
</span><del>- case F32:
- case F64:
</del><ins>+ case Wasm::F32:
+ case Wasm::F64:
</ins><span class="cx"> result = block->appendNew<Value>(proc, BitwiseCast, Origin(), result);
</span><span class="cx"> FALLTHROUGH;
</span><del>- case I32:
- case I64:
</del><ins>+ case Wasm::I32:
+ case Wasm::I64:
</ins><span class="cx"> block->appendNewControlValue(proc, B3::Return, Origin(), result);
</span><span class="cx"> break;
</span><ins>+ case Wasm::Func:
+ case Wasm::Anyfunc:
+ RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return std::make_unique<Compilation>(vm, proc);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmCallingConventionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> case B3::Float:
</span><span class="cx"> case B3::Double:
</span><span class="cx"> return marshallArgumentImpl(m_fprArgs, type, fpArgumentCount, stackOffset);
</span><del>- case Void:
</del><ins>+ case B3::Void:
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFormatcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFormat.cpp (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFormat.cpp        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmFormat.cpp        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -31,35 +31,10 @@
</span><span class="cx">
</span><span class="cx"> #include "WasmMemory.h"
</span><span class="cx">
</span><del>-#if COMPILER(GCC) && ASSERT_DISABLED
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wreturn-type"
-#endif // COMPILER(GCC) && ASSERT_DISABLED
-
</del><span class="cx"> namespace JSC { namespace Wasm {
</span><span class="cx">
</span><del>-const char* toString(Type type)
-{
- switch (type) {
- case Void:
- return "void";
- case I32:
- return "i32";
- case I64:
- return "i64";
- case F32:
- return "f32";
- case F64:
- return "f64";
- }
-}
-
</del><span class="cx"> ModuleInformation::~ModuleInformation() { }
</span><span class="cx">
</span><span class="cx"> } } // namespace JSC::Wasm
</span><span class="cx">
</span><del>-#if COMPILER(GCC) && ASSERT_DISABLED
-#pragma GCC diagnostic pop
-#endif // COMPILER(GCC) && ASSERT_DISABLED
-
</del><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFormath"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFormat.h (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFormat.h        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmFormat.h        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "B3Type.h"
</span><span class="cx"> #include "CodeLocation.h"
</span><span class="cx"> #include "Identifier.h"
</span><ins>+#include "WasmOps.h"
</ins><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -39,33 +40,6 @@
</span><span class="cx">
</span><span class="cx"> namespace Wasm {
</span><span class="cx">
</span><del>-enum Type : uint8_t {
- Void,
- I32,
- I64,
- F32,
- F64,
- LastValueType = F64,
-};
-
-static_assert(I32 == 1, "Wasm needs I32 to have the value 1");
-static_assert(I64 == 2, "Wasm needs I64 to have the value 2");
-static_assert(F32 == 3, "Wasm needs F32 to have the value 3");
-static_assert(F64 == 4, "Wasm needs F64 to have the value 4");
-
-inline B3::Type toB3Type(Type type)
-{
- switch (type) {
- case I32: return B3::Int32;
- case I64: return B3::Int64;
- case F32: return B3::Float;
- case F64: return B3::Double;
- case Void: return B3::Void;
- default: break;
- }
- RELEASE_ASSERT_NOT_REACHED();
-}
-
</del><span class="cx"> inline bool isValueType(Type type)
</span><span class="cx"> {
</span><span class="cx"> switch (type) {
</span><span class="lines">@@ -79,11 +53,10 @@
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>-
-const char* toString(Type);
</del><span class="cx">
</span><span class="cx"> struct External {
</span><span class="cx"> enum Kind : uint8_t {
</span><ins>+ // FIXME auto-generate this. https://bugs.webkit.org/show_bug.cgi?id=165231
</ins><span class="cx"> Function = 0,
</span><span class="cx"> Table = 1,
</span><span class="cx"> Memory = 2,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFunctionParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx"> bool FunctionParser<Context>::parseExpression(OpType op)
</span><span class="cx"> {
</span><span class="cx"> switch (op) {
</span><del>-#define CREATE_CASE(name, id, b3op) case OpType::name: return binaryCase<OpType::name>();
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case OpType::name: return binaryCase<OpType::name>();
</ins><span class="cx"> FOR_EACH_WASM_SIMPLE_BINARY_OP(CREATE_CASE)
</span><span class="cx"> #undef CREATE_CASE
</span><span class="cx">
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx"> case OpType::F64Nearest: return unaryCase<OpType::F64Nearest>();
</span><span class="cx"> case OpType::F32Trunc: return unaryCase<OpType::F32Trunc>();
</span><span class="cx"> case OpType::F64Trunc: return unaryCase<OpType::F64Trunc>();
</span><del>-#define CREATE_CASE(name, id, b3op) case OpType::name: return unaryCase<OpType::name>();
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case OpType::name: return unaryCase<OpType::name>();
</ins><span class="cx"> FOR_EACH_WASM_SIMPLE_UNARY_OP(CREATE_CASE)
</span><span class="cx"> #undef CREATE_CASE
</span><span class="cx">
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define CREATE_CASE(name, id, b3op) case OpType::name:
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case OpType::name:
</ins><span class="cx"> FOR_EACH_WASM_MEMORY_LOAD_OP(CREATE_CASE) {
</span><span class="cx"> uint32_t alignment;
</span><span class="cx"> if (!parseVarUInt32(alignment))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmModuleParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Skip the version number for now since we don't do anything with it.
</del><span class="cx"> uint32_t versionNumber;
</span><span class="cx"> if (!parseUInt32(versionNumber)) {
</span><span class="cx"> // FIXME improve error message https://bugs.webkit.org/show_bug.cgi?id=163919
</span><span class="lines">@@ -62,7 +61,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (versionNumber != magicNumber) {
</del><ins>+ if (versionNumber != expectedVersionNumber) {
</ins><span class="cx"> // FIXME improve error message https://bugs.webkit.org/show_bug.cgi?id=163919
</span><span class="cx"> m_errorMessage = "unexpected version number";
</span><span class="cx"> return false;
</span><span class="lines">@@ -169,7 +168,7 @@
</span><span class="cx"> int8_t type;
</span><span class="cx"> if (!parseInt7(type))
</span><span class="cx"> return false;
</span><del>- if (type != -0x20) // Function type constant. FIXME auto-generate from JSON file.
</del><ins>+ if (type != Func)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (verbose)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmModuleParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmModuleParser.h (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmModuleParser.h        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmModuleParser.h        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -37,8 +37,6 @@
</span><span class="cx"> class ModuleParser : public Parser {
</span><span class="cx"> public:
</span><span class="cx">
</span><del>- static const unsigned magicNumber = 0xc;
-
</del><span class="cx"> ModuleParser(VM* vm, const uint8_t* sourceBuffer, size_t sourceLength)
</span><span class="cx"> : Parser(sourceBuffer, sourceLength)
</span><span class="cx"> , m_vm(vm)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmParser.h (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmParser.h        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/WasmParser.h        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -169,10 +169,10 @@
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE bool Parser::parseResultType(Type& result)
</span><span class="cx"> {
</span><del>- uint8_t value;
- if (!parseUInt7(value))
</del><ins>+ int8_t value;
+ if (!parseInt7(value))
</ins><span class="cx"> return false;
</span><del>- if (value > static_cast<uint8_t>(Type::LastValueType))
</del><ins>+ if (!isValidType(value))
</ins><span class="cx"> return false;
</span><span class="cx"> result = static_cast<Type>(value);
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmgenerateWasmpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/generateWasm.py (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/generateWasm.py        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/generateWasm.py        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -33,6 +33,11 @@
</span><span class="cx"> wasmFile = open(jsonPath, "r")
</span><span class="cx"> wasm = json.load(open(jsonPath, "r"))
</span><span class="cx"> wasmFile.close()
</span><ins>+ for pre in wasm["preamble"]:
+ if pre["name"] == "version":
+ self.expectedVersionNumber = str(pre["value"])
+ self.preamble = wasm["preamble"]
+ self.types = wasm["type"]
</ins><span class="cx"> self.opcodes = wasm["opcode"]
</span><span class="cx"> self.header = """/*
</span><span class="cx"> * Copyright (C) 2016 Apple Inc. All rights reserved.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmgenerateWasmOpsHeaderpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -35,20 +35,34 @@
</span><span class="cx"> parser.error(parser.usage)
</span><span class="cx">
</span><span class="cx"> wasm = Wasm(args[0], args[1])
</span><ins>+types = wasm.types
</ins><span class="cx"> opcodes = wasm.opcodes
</span><span class="cx"> wasmOpsHFile = open(args[2], "w")
</span><span class="cx">
</span><span class="cx">
</span><del>-def cppMacro(wasmOpcode, value, b3Opcode):
- return " \\\n macro(" + wasm.toCpp(wasmOpcode) + ", " + hex(int(value)) + ", " + b3Opcode + ")"
</del><ins>+def cppMacro(wasmOpcode, value, b3, inc):
+ return " \\\n macro(" + wasm.toCpp(wasmOpcode) + ", " + hex(int(value)) + ", " + b3 + ", " + str(inc) + ")"
</ins><span class="cx">
</span><span class="cx">
</span><ins>+def typeMacroizer():
+ inc = 0
+ for ty in wasm.types:
+ yield cppMacro(ty, wasm.types[ty]["value"], wasm.types[ty]["b3type"], inc)
+ inc += 1
+
+type_definitions = ["#define FOR_EACH_WASM_TYPE(macro)"]
+type_definitions.extend([t for t in typeMacroizer()])
+type_definitions = "".join(type_definitions)
+
+
</ins><span class="cx"> def opcodeMacroizer(filter):
</span><ins>+ inc = 0
</ins><span class="cx"> for op in wasm.opcodeIterator(filter):
</span><span class="cx"> b3op = "Oops"
</span><span class="cx"> if isSimple(op["opcode"]):
</span><span class="cx"> b3op = op["opcode"]["b3op"]
</span><del>- yield cppMacro(op["name"], op["opcode"]["value"], b3op)
</del><ins>+ yield cppMacro(op["name"], op["opcode"]["value"], b3op, inc)
+ inc += 1
</ins><span class="cx">
</span><span class="cx"> defines = ["#define FOR_EACH_WASM_SPECIAL_OP(macro)"]
</span><span class="cx"> defines.extend([op for op in opcodeMacroizer(lambda op: op["category"] == "special" or op["category"] == "call")])
</span><span class="lines">@@ -101,6 +115,75 @@
</span><span class="cx">
</span><span class="cx"> namespace JSC { namespace Wasm {
</span><span class="cx">
</span><ins>+static constexpr unsigned expectedVersionNumber = """ + wasm.expectedVersionNumber + """;
+
+static constexpr unsigned numTypes = """ + str(len(types)) + """;
+
+""" + type_definitions + """
+#define CREATE_ENUM_VALUE(name, id, b3type, inc) name = id,
+enum Type : int8_t {
+ FOR_EACH_WASM_TYPE(CREATE_ENUM_VALUE)
+};
+#undef CREATE_ENUM_VALUE
+
+#define CREATE_CASE(name, id, b3type, inc) case id: return true;
+template <typename Int>
+inline bool isValidType(Int i)
+{
+ switch (i) {
+ default: return false;
+ FOR_EACH_WASM_TYPE(CREATE_CASE)
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return false;
+}
+#undef CREATE_CASE
+
+#define CREATE_CASE(name, id, b3type, inc) case name: return b3type;
+inline B3::Type toB3Type(Type type)
+{
+ switch (type) {
+ FOR_EACH_WASM_TYPE(CREATE_CASE)
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return B3::Void;
+}
+#undef CREATE_CASE
+
+#define CREATE_CASE(name, id, b3type, inc) case name: return "name";
+inline const char* toString(Type type)
+{
+ switch (type) {
+ FOR_EACH_WASM_TYPE(CREATE_CASE)
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return nullptr;
+}
+#undef CREATE_CASE
+
+#define CREATE_CASE(name, id, b3type, inc) case id: return inc;
+inline int linearizeType(Type type)
+{
+ switch (type) {
+ FOR_EACH_WASM_TYPE(CREATE_CASE)
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return 0;
+}
+#undef CREATE_CASE
+
+#define CREATE_CASE(name, id, b3type, inc) case inc: return name;
+inline Type linearizedToType(int i)
+{
+ switch (i) {
+ FOR_EACH_WASM_TYPE(CREATE_CASE)
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return Void;
+}
+#undef CREATE_CASE
+
+
</ins><span class="cx"> """ + defines + """
</span><span class="cx"> #define FOR_EACH_WASM_OP(macro) \\
</span><span class="cx"> FOR_EACH_WASM_SPECIAL_OP(macro) \\
</span><span class="lines">@@ -110,7 +193,7 @@
</span><span class="cx"> FOR_EACH_WASM_MEMORY_LOAD_OP(macro) \\
</span><span class="cx"> FOR_EACH_WASM_MEMORY_STORE_OP(macro)
</span><span class="cx">
</span><del>-#define CREATE_ENUM_VALUE(name, id, b3op) name = id,
</del><ins>+#define CREATE_ENUM_VALUE(name, id, b3op, inc) name = id,
</ins><span class="cx">
</span><span class="cx"> enum OpType : uint8_t {
</span><span class="cx"> FOR_EACH_WASM_OP(CREATE_ENUM_VALUE)
</span><span class="lines">@@ -145,7 +228,7 @@
</span><span class="cx"> inline bool isControlOp(OpType op)
</span><span class="cx"> {
</span><span class="cx"> switch (op) {
</span><del>-#define CREATE_CASE(name, id, b3op) case OpType::name:
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case OpType::name:
</ins><span class="cx"> FOR_EACH_WASM_CONTROL_FLOW_OP(CREATE_CASE)
</span><span class="cx"> return true;
</span><span class="cx"> #undef CREATE_CASE
</span><span class="lines">@@ -158,7 +241,7 @@
</span><span class="cx"> inline bool isSimple(UnaryOpType op)
</span><span class="cx"> {
</span><span class="cx"> switch (op) {
</span><del>-#define CREATE_CASE(name, id, b3op) case UnaryOpType::name:
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case UnaryOpType::name:
</ins><span class="cx"> FOR_EACH_WASM_SIMPLE_UNARY_OP(CREATE_CASE)
</span><span class="cx"> return true;
</span><span class="cx"> #undef CREATE_CASE
</span><span class="lines">@@ -171,7 +254,7 @@
</span><span class="cx"> inline bool isSimple(BinaryOpType op)
</span><span class="cx"> {
</span><span class="cx"> switch (op) {
</span><del>-#define CREATE_CASE(name, id, b3op) case BinaryOpType::name:
</del><ins>+#define CREATE_CASE(name, id, b3op, inc) case BinaryOpType::name:
</ins><span class="cx"> FOR_EACH_WASM_SIMPLE_BINARY_OP(CREATE_CASE)
</span><span class="cx"> return true;
</span><span class="cx"> #undef CREATE_CASE
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -63,10 +63,6 @@
</span><span class="cx"> for (unsigned argIndex = 0; argIndex < exec->argumentCount(); ++argIndex) {
</span><span class="cx"> JSValue arg = exec->uncheckedArgument(argIndex);
</span><span class="cx"> switch (signature->arguments[argIndex]) {
</span><del>- case Wasm::Void:
- case Wasm::I64:
- RELEASE_ASSERT_NOT_REACHED();
- break;
</del><span class="cx"> case Wasm::I32:
</span><span class="cx"> arg = JSValue::decode(arg.toInt32(exec));
</span><span class="cx"> break;
</span><span class="lines">@@ -76,6 +72,11 @@
</span><span class="cx"> case Wasm::F64:
</span><span class="cx"> arg = JSValue::decode(bitwise_cast<uint64_t>(arg.toNumber(exec)));
</span><span class="cx"> break;
</span><ins>+ case Wasm::Void:
+ case Wasm::I64:
+ case Wasm::Func:
+ case Wasm::Anyfunc:
+ RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, encodedJSValue());
</span><span class="cx"> boxedArgs.append(arg);
</span><span class="lines">@@ -99,8 +100,6 @@
</span><span class="cx"> switch (signature->returnType) {
</span><span class="cx"> case Wasm::Void:
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- case Wasm::I64:
- RELEASE_ASSERT_NOT_REACHED();
</del><span class="cx"> case Wasm::I32:
</span><span class="cx"> return JSValue::encode(JSValue(static_cast<int32_t>(rawResult)));
</span><span class="cx"> case Wasm::F32:
</span><span class="lines">@@ -107,9 +106,14 @@
</span><span class="cx"> return JSValue::encode(JSValue(bitwise_cast<float>(static_cast<int32_t>(rawResult))));
</span><span class="cx"> case Wasm::F64:
</span><span class="cx"> return JSValue::encode(JSValue(bitwise_cast<double>(rawResult)));
</span><ins>+ case Wasm::I64:
+ case Wasm::Func:
+ case Wasm::Anyfunc:
+ break;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><ins>+ return EncodedJSValue();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebAssemblyFunction* WebAssemblyFunction::create(VM& vm, JSGlobalObject* globalObject, int length, const String& name, JSWebAssemblyInstance* instance, CallableWebAssemblyFunction&& callable)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/wasm.json (209305 => 209306)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/wasm.json        2016-12-03 21:43:04 UTC (rev 209305)
+++ trunk/Source/JavaScriptCore/wasm/wasm.json        2016-12-03 22:58:26 UTC (rev 209306)
</span><span class="lines">@@ -1,25 +1,23 @@
</span><span class="cx"> {
</span><span class="cx"> "comments": ["This file describes the WebAssembly ISA.",
</span><del>- "Scripts in this folder auto-generate C++ code for JavaScriptCore as well as the testing DSL which WebKit's WebAssembly tests use.",
- "When you update this file you need to re-generate the C++ code: jsc ./JSTests/stress/wasm/generate-wasmops-header.js > ./Source/JavaScriptCore/wasm/WASMOps.h"
</del><ins>+ "Scripts in this folder auto-generate C++ code for JavaScriptCore as well as the testing DSL which WebKit's WebAssembly tests use."
</ins><span class="cx"> ],
</span><span class="cx"> "preamble": [
</span><span class="cx"> { "name": "magic number", "type": "uint32", "value": 1836278016, "description": "NULL character followed by 'asm'" },
</span><del>- { "name": "version", "type": "uint32", "value": 12, "description": "Version number, will be reset to 1 for MVP" }
</del><ins>+ { "name": "version", "type": "uint32", "value": 13, "description": "Version number, will be reset to 1 for MVP" }
</ins><span class="cx"> ],
</span><del>- "value_type" : {
- "i32": { "type": "uint8", "value": 1 },
- "i64": { "type": "uint8", "value": 2 },
- "f32": { "type": "uint8", "value": 3 },
- "f64": { "type": "uint8", "value": 4 }
</del><ins>+ "type" : {
+ "i32": { "type": "varint7", "value": -1, "b3type": "B3::Int32" },
+ "i64": { "type": "varint7", "value": -2, "b3type": "B3::Int64" },
+ "f32": { "type": "varint7", "value": -3, "b3type": "B3::Float" },
+ "f64": { "type": "varint7", "value": -4, "b3type": "B3::Double" },
+ "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Void" },
+ "func": { "type": "varint7", "value": -32, "b3type": "B3::Void" },
+ "void": { "type": "varint7", "value": -64, "b3type": "B3::Void" }
</ins><span class="cx"> },
</span><del>- "inline_signature_type" : {
- "void": { "type": "uint8", "value": 0 },
- "i32": { "type": "uint8", "value": 1 },
- "i64": { "type": "uint8", "value": 2 },
- "f32": { "type": "uint8", "value": 3 },
- "f64": { "type": "uint8", "value": 4 }
- },
</del><ins>+ "value_type": ["i32", "i64", "f32", "f64"],
+ "block_type": ["i32", "i64", "f32", "f64", "void"],
+ "elem_type": ["anyfunc"],
</ins><span class="cx"> "external_kind": {
</span><span class="cx"> "Function": { "type": "uint8", "value": 0 },
</span><span class="cx"> "Table": { "type": "uint8", "value": 1 },
</span><span class="lines">@@ -41,179 +39,179 @@
</span><span class="cx"> },
</span><span class="cx"> "opcode": {
</span><span class="cx"> "unreachable": { "category": "control", "value": 0, "return": [], "parameter": [], "immediate": [], "description": "trap immediately" },
</span><del>- "block": { "category": "control", "value": 1, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a sequence of expressions, yielding 0 or 1 values" },
- "loop": { "category": "control", "value": 2, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a block which can also form control flow loops" },
- "if": { "category": "control", "value": 3, "return": ["control"], "parameter": ["bool"], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin if expression" },
- "else": { "category": "control", "value": 4, "return": ["control"], "parameter": [], "immediate": [], "description": "begin else expression of if" },
- "select": { "category": "control", "value": 5, "return": ["prev"], "parameter": ["any", "prev", "bool"], "immediate": [], "description": "select one of two values based on condition" },
- "br": { "category": "control", "value": 6, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "break that targets an outer nested block" },
- "br_if": { "category": "control", "value": 7, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "conditional break that targets an outer nested block" },
- "br_table": { "category": "control", "value": 8, "return": [], "parameter": [], "immediate": [{"name": "target_count", "type": "varuint32", "description": "number of entries in the target_table"},
</del><ins>+ "block": { "category": "control", "value": 2, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin a sequence of expressions, yielding 0 or 1 values" },
+ "loop": { "category": "control", "value": 3, "return": ["control"], "parameter": [], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin a block which can also form control flow loops" },
+ "if": { "category": "control", "value": 4, "return": ["control"], "parameter": ["bool"], "immediate": [{"name": "sig", "type": "block_type"}], "description": "begin if expression" },
+ "else": { "category": "control", "value": 5, "return": ["control"], "parameter": [], "immediate": [], "description": "begin else expression of if" },
+ "select": { "category": "control", "value": 27, "return": ["prev"], "parameter": ["any", "prev", "bool"], "immediate": [], "description": "select one of two values based on condition" },
+ "br": { "category": "control", "value": 12, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "break that targets an outer nested block" },
+ "br_if": { "category": "control", "value": 13, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "conditional break that targets an outer nested block" },
+ "br_table": { "category": "control", "value": 14, "return": [], "parameter": [], "immediate": [{"name": "target_count", "type": "varuint32", "description": "number of entries in the target_table"},
</ins><span class="cx"> {"name": "target_table", "type": "varuint32*", "description": "target entries that indicate an outer block or loop to which to break"},
</span><span class="cx"> {"name": "default_target", "type": "varuint32", "description": "an outer block or loop to which to break in the default case"}],
</span><span class="cx"> "description": "branch table control flow construct" },
</span><del>- "return": { "category": "control", "value": 9, "return": [], "parameter": [], "immediate": [], "description": "return zero or one value from this function" },
- "drop": { "category": "control", "value": 11, "return": [], "parameter": ["any"], "immediate": [], "description": "ignore value" },
- "nop": { "category": "control", "value": 10, "return": [], "parameter": [], "immediate": [], "description": "no operation" },
- "end": { "category": "control", "value": 15, "return": [], "parameter": [], "immediate": [], "description": "end a block, loop, or if" },
- "i32.const": { "category": "special", "value": 16, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
- "i64.const": { "category": "special", "value": 17, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
- "f64.const": { "category": "special", "value": 18, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "uint64"}], "description": "a constant value interpreted as f64" },
- "f32.const": { "category": "special", "value": 19, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "uint32"}], "description": "a constant value interpreted as f32" },
- "get_local": { "category": "special", "value": 20, "return": ["local"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
- "set_local": { "category": "special", "value": 21, "return": [], "parameter": ["local"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
- "tee_local": { "category": "special", "value": 25, "return": ["prev"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
- "get_global": { "category": "special", "value": 187, "return": ["global"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
- "set_global": { "category": "special", "value": 188, "return": [""], "parameter": ["global"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "write a global variable" },
- "call": { "category": "call", "value": 22, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" },
- "call_indirect": { "category": "call", "value": 23, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}], "description": "call a function indirect with an expected signature" },
- "i32.load8_s": { "category": "memory", "value": 32, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load8_u": { "category": "memory", "value": 33, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load16_s": { "category": "memory", "value": 34, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load16_u": { "category": "memory", "value": 35, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load8_s": { "category": "memory", "value": 36, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load8_u": { "category": "memory", "value": 37, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load16_s": { "category": "memory", "value": 38, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load16_u": { "category": "memory", "value": 39, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load32_s": { "category": "memory", "value": 40, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load32_u": { "category": "memory", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.load": { "category": "memory", "value": 42, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i64.load": { "category": "memory", "value": 43, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "f32.load": { "category": "memory", "value": 44, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "f64.load": { "category": "memory", "value": 45, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
- "i32.store8": { "category": "memory", "value": 46, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i32.store16": { "category": "memory", "value": 47, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store8": { "category": "memory", "value": 48, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store16": { "category": "memory", "value": 49, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store32": { "category": "memory", "value": 50, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i32.store": { "category": "memory", "value": 51, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "i64.store": { "category": "memory", "value": 52, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "f32.store": { "category": "memory", "value": 53, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "f64.store": { "category": "memory", "value": 54, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
- "current_memory": { "category": "operation", "value": 59, "return": ["size"], "parameter": [], "immediate": [], "description": "query the size of memory" },
- "grow_memory": { "category": "operation", "value": 57, "return": ["size"], "parameter": ["size"], "immediate": [], "description": "grow the size of memory" },
- "i32.add": { "category": "arithmetic", "value": 64, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Add" },
- "i32.sub": { "category": "arithmetic", "value": 65, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Sub" },
- "i32.mul": { "category": "arithmetic", "value": 66, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mul" },
- "i32.div_s": { "category": "arithmetic", "value": 67, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Div" },
- "i32.div_u": { "category": "arithmetic", "value": 68, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UDiv" },
- "i32.rem_s": { "category": "arithmetic", "value": 69, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mod" },
- "i32.rem_u": { "category": "arithmetic", "value": 70, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UMod" },
- "i32.and": { "category": "arithmetic", "value": 71, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitAnd" },
- "i32.or": { "category": "arithmetic", "value": 72, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitOr" },
- "i32.xor": { "category": "arithmetic", "value": 73, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitXor" },
- "i32.shl": { "category": "arithmetic", "value": 74, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Shl" },
- "i32.shr_u": { "category": "arithmetic", "value": 75, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "SShr" },
- "i32.shr_s": { "category": "arithmetic", "value": 76, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "ZShr" },
- "i32.rotr": { "category": "arithmetic", "value": 182, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotR" },
- "i32.rotl": { "category": "arithmetic", "value": 183, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotL" },
- "i32.eq": { "category": "comparison", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Equal" },
- "i32.ne": { "category": "comparison", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "NotEqual" },
- "i32.lt_s": { "category": "comparison", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessThan" },
- "i32.le_s": { "category": "comparison", "value": 80, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessEqual" },
- "i32.lt_u": { "category": "comparison", "value": 81, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Below" },
- "i32.le_u": { "category": "comparison", "value": 82, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BelowEqual" },
- "i32.gt_s": { "category": "comparison", "value": 83, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterThan" },
- "i32.ge_s": { "category": "comparison", "value": 84, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterEqual" },
- "i32.gt_u": { "category": "comparison", "value": 85, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Above" },
- "i32.ge_u": { "category": "comparison", "value": 86, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "AboveEqual" },
- "i32.clz": { "category": "arithmetic", "value": 87, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "Clz" },
- "i32.ctz": { "category": "arithmetic", "value": 88, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
- "i32.popcnt": { "category": "arithmetic", "value": 89, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
- "i32.eqz": { "category": "comparison", "value": 90, "return": ["bool"], "parameter": ["i32"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
- "i64.add": { "category": "arithmetic", "value": 91, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Add" },
- "i64.sub": { "category": "arithmetic", "value": 92, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Sub" },
- "i64.mul": { "category": "arithmetic", "value": 93, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mul" },
- "i64.div_s": { "category": "arithmetic", "value": 94, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Div" },
- "i64.div_u": { "category": "arithmetic", "value": 95, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
- "i64.rem_s": { "category": "arithmetic", "value": 96, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mod" },
- "i64.rem_u": { "category": "arithmetic", "value": 97, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
- "i64.and": { "category": "arithmetic", "value": 98, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitAnd" },
- "i64.or": { "category": "arithmetic", "value": 99, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitOr" },
- "i64.xor": { "category": "arithmetic", "value": 100, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitXor" },
- "i64.shl": { "category": "arithmetic", "value": 101, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Shl" },
- "i64.shr_u": { "category": "arithmetic", "value": 102, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "SShr" },
- "i64.shr_s": { "category": "arithmetic", "value": 103, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "ZShr" },
- "i64.rotr": { "category": "arithmetic", "value": 184, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotR" },
- "i64.rotl": { "category": "arithmetic", "value": 185, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotL" },
- "i64.eq": { "category": "comparison", "value": 104, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Equal" },
- "i64.ne": { "category": "comparison", "value": 105, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "NotEqual" },
- "i64.lt_s": { "category": "comparison", "value": 106, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessThan" },
- "i64.le_s": { "category": "comparison", "value": 107, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessEqual" },
- "i64.lt_u": { "category": "comparison", "value": 108, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Below" },
- "i64.le_u": { "category": "comparison", "value": 109, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BelowEqual" },
- "i64.gt_s": { "category": "comparison", "value": 110, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterThan" },
- "i64.ge_s": { "category": "comparison", "value": 111, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterEqual" },
- "i64.gt_u": { "category": "comparison", "value": 112, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Above" },
- "i64.ge_u": { "category": "comparison", "value": 113, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "AboveEqual" },
- "i64.clz": { "category": "arithmetic", "value": 114, "return": ["i64"], "parameter": ["i64"], "immediate": [], "b3op": "Clz" },
- "i64.ctz": { "category": "arithmetic", "value": 115, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
- "i64.popcnt": { "category": "arithmetic", "value": 116, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
- "i64.eqz": { "category": "comparison", "value": 186, "return": ["bool"], "parameter": ["i64"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
- "f32.add": { "category": "arithmetic", "value": 117, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Add" },
- "f32.sub": { "category": "arithmetic", "value": 118, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Sub" },
- "f32.mul": { "category": "arithmetic", "value": 119, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Mul" },
- "f32.div": { "category": "arithmetic", "value": 120, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Div" },
- "f32.min": { "category": "arithmetic", "value": 121, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
- "f32.max": { "category": "arithmetic", "value": 122, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
- "f32.abs": { "category": "arithmetic", "value": 123, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Abs" },
- "f32.neg": { "category": "arithmetic", "value": 124, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Neg" },
- "f32.copysign": { "category": "arithmetic", "value": 125, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i32(0x80000000)), BitAnd(BitwiseCast(@0), i32(0x7fffffff))))" },
- "f32.ceil": { "category": "arithmetic", "value": 126, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Ceil" },
- "f32.floor": { "category": "arithmetic", "value": 127, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Floor" },
- "f32.trunc": { "category": "arithmetic", "value": 128, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
- "f32.nearest": { "category": "arithmetic", "value": 129, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
- "f32.sqrt": { "category": "arithmetic", "value": 130, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Sqrt" },
- "f32.eq": { "category": "comparison", "value": 131, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Equal" },
- "f32.ne": { "category": "comparison", "value": 132, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "NotEqual" },
- "f32.lt": { "category": "comparison", "value": 133, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessThan" },
- "f32.le": { "category": "comparison", "value": 134, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessEqual" },
- "f32.gt": { "category": "comparison", "value": 135, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterThan" },
- "f32.ge": { "category": "comparison", "value": 136, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterEqual" },
- "f64.add": { "category": "arithmetic", "value": 137, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Add" },
- "f64.sub": { "category": "arithmetic", "value": 138, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Sub" },
- "f64.mul": { "category": "arithmetic", "value": 139, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Mul" },
- "f64.div": { "category": "arithmetic", "value": 140, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Div" },
- "f64.min": { "category": "arithmetic", "value": 141, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
- "f64.max": { "category": "arithmetic", "value": 142, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
- "f64.abs": { "category": "arithmetic", "value": 143, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Abs" },
- "f64.neg": { "category": "arithmetic", "value": 144, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Neg" },
- "f64.copysign": { "category": "arithmetic", "value": 145, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i64(0x8000000000000000)), BitAnd(BitwiseCast(@0), i64(0x7fffffffffffffff))))" },
- "f64.ceil": { "category": "arithmetic", "value": 146, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Ceil" },
- "f64.floor": { "category": "arithmetic", "value": 147, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Floor" },
- "f64.trunc": { "category": "arithmetic", "value": 148, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
- "f64.nearest": { "category": "arithmetic", "value": 149, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
- "f64.sqrt": { "category": "arithmetic", "value": 150, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Sqrt" },
- "f64.eq": { "category": "comparison", "value": 151, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Equal" },
- "f64.ne": { "category": "comparison", "value": 152, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "NotEqual" },
- "f64.lt": { "category": "comparison", "value": 153, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessThan" },
- "f64.le": { "category": "comparison", "value": 154, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessEqual" },
- "f64.gt": { "category": "comparison", "value": 155, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterThan" },
- "f64.ge": { "category": "comparison", "value": 156, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterEqual" },
- "i32.trunc_s/f32": { "category": "conversion", "value": 157, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
- "i32.trunc_s/f64": { "category": "conversion", "value": 158, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
- "i32.trunc_u/f32": { "category": "conversion", "value": 159, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
- "i32.trunc_u/f64": { "category": "conversion", "value": 160, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
- "i32.wrap/i64": { "category": "conversion", "value": 161, "return": ["i32"], "parameter": ["i64"], "immediate": [] },
- "i64.trunc_s/f32": { "category": "conversion", "value": 162, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
- "i64.trunc_s/f64": { "category": "conversion", "value": 163, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
- "i64.trunc_u/f32": { "category": "conversion", "value": 164, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
- "i64.trunc_u/f64": { "category": "conversion", "value": 165, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
- "i64.extend_s/i32": { "category": "conversion", "value": 166, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "SExt32" },
- "i64.extend_u/i32": { "category": "conversion", "value": 167, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "ZExt32" },
- "f32.convert_s/i32": { "category": "conversion", "value": 168, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF" },
- "f32.convert_u/i32": { "category": "conversion", "value": 169, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF(ZExt32(@0))" },
- "f32.convert_s/i64": { "category": "conversion", "value": 170, "return": ["f32"], "parameter": ["i64"], "immediate": [], "b3op": "IToF" },
- "f32.convert_u/i64": { "category": "conversion", "value": 171, "return": ["f32"], "parameter": ["i64"], "immediate": [] },
- "f32.demote/f64": { "category": "conversion", "value": 172, "return": ["f32"], "parameter": ["f64"], "immediate": [], "b3op": "DoubleToFloat"},
- "f32.reinterpret/i32": { "category": "conversion", "value": 173, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "BitwiseCast" },
- "f64.convert_s/i32": { "category": "conversion", "value": 174, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD" },
- "f64.convert_u/i32": { "category": "conversion", "value": 175, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD(ZExt32(@0))" },
- "f64.convert_s/i64": { "category": "conversion", "value": 176, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "IToD" },
- "f64.convert_u/i64": { "category": "conversion", "value": 177, "return": ["f64"], "parameter": ["i64"], "immediate": [] },
- "f64.promote/f32": { "category": "conversion", "value": 178, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"},
- "f64.reinterpret/i64": { "category": "conversion", "value": 179, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" },
- "i32.reinterpret/f32": { "category": "conversion", "value": 180, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" },
- "i64.reinterpret/f64": { "category": "conversion", "value": 181, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }
</del><ins>+ "return": { "category": "control", "value": 15, "return": [], "parameter": [], "immediate": [], "description": "return zero or one value from this function" },
+ "drop": { "category": "control", "value": 26, "return": [], "parameter": ["any"], "immediate": [], "description": "ignore value" },
+ "nop": { "category": "control", "value": 1, "return": [], "parameter": [], "immediate": [], "description": "no operation" },
+ "end": { "category": "control", "value": 11, "return": [], "parameter": [], "immediate": [], "description": "end a block, loop, or if" },
+ "i32.const": { "category": "special", "value": 65, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
+ "i64.const": { "category": "special", "value": 66, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
+ "f64.const": { "category": "special", "value": 68, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "uint64"}], "description": "a constant value interpreted as f64" },
+ "f32.const": { "category": "special", "value": 67, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "uint32"}], "description": "a constant value interpreted as f32" },
+ "get_local": { "category": "special", "value": 32, "return": ["local"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
+ "set_local": { "category": "special", "value": 33, "return": [], "parameter": ["local"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
+ "tee_local": { "category": "special", "value": 34, "return": ["prev"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
+ "get_global": { "category": "special", "value": 35, "return": ["global"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
+ "set_global": { "category": "special", "value": 36, "return": [""], "parameter": ["global"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "write a global variable" },
+ "call": { "category": "call", "value": 16, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" },
+ "call_indirect": { "category": "call", "value": 17, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}], "description": "call a function indirect with an expected signature" },
+ "i32.load8_s": { "category": "memory", "value": 44, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load8_u": { "category": "memory", "value": 45, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_s": { "category": "memory", "value": 46, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_u": { "category": "memory", "value": 47, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_s": { "category": "memory", "value": 48, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_u": { "category": "memory", "value": 49, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_s": { "category": "memory", "value": 50, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_u": { "category": "memory", "value": 51, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_s": { "category": "memory", "value": 52, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_u": { "category": "memory", "value": 53, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load": { "category": "memory", "value": 40, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load": { "category": "memory", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f32.load": { "category": "memory", "value": 42, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f64.load": { "category": "memory", "value": 43, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.store8": { "category": "memory", "value": 58, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store16": { "category": "memory", "value": 59, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store8": { "category": "memory", "value": 60, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store16": { "category": "memory", "value": 61, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store32": { "category": "memory", "value": 62, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store": { "category": "memory", "value": 54, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store": { "category": "memory", "value": 55, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f32.store": { "category": "memory", "value": 56, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f64.store": { "category": "memory", "value": 57, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "current_memory": { "category": "operation", "value": 63, "return": ["size"], "parameter": [], "immediate": [], "description": "query the size of memory" },
+ "grow_memory": { "category": "operation", "value": 64, "return": ["size"], "parameter": ["size"], "immediate": [], "description": "grow the size of memory" },
+ "i32.add": { "category": "arithmetic", "value": 106, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Add" },
+ "i32.sub": { "category": "arithmetic", "value": 107, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Sub" },
+ "i32.mul": { "category": "arithmetic", "value": 108, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mul" },
+ "i32.div_s": { "category": "arithmetic", "value": 109, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Div" },
+ "i32.div_u": { "category": "arithmetic", "value": 110, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UDiv" },
+ "i32.rem_s": { "category": "arithmetic", "value": 111, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mod" },
+ "i32.rem_u": { "category": "arithmetic", "value": 112, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "UMod" },
+ "i32.and": { "category": "arithmetic", "value": 113, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitAnd" },
+ "i32.or": { "category": "arithmetic", "value": 114, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitOr" },
+ "i32.xor": { "category": "arithmetic", "value": 115, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitXor" },
+ "i32.shl": { "category": "arithmetic", "value": 116, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Shl" },
+ "i32.shr_u": { "category": "arithmetic", "value": 118, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "SShr" },
+ "i32.shr_s": { "category": "arithmetic", "value": 117, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "ZShr" },
+ "i32.rotr": { "category": "arithmetic", "value": 120, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotR" },
+ "i32.rotl": { "category": "arithmetic", "value": 119, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotL" },
+ "i32.eq": { "category": "comparison", "value": 70, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Equal" },
+ "i32.ne": { "category": "comparison", "value": 71, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "NotEqual" },
+ "i32.lt_s": { "category": "comparison", "value": 72, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessThan" },
+ "i32.le_s": { "category": "comparison", "value": 76, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessEqual" },
+ "i32.lt_u": { "category": "comparison", "value": 73, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Below" },
+ "i32.le_u": { "category": "comparison", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BelowEqual" },
+ "i32.gt_s": { "category": "comparison", "value": 74, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterThan" },
+ "i32.ge_s": { "category": "comparison", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterEqual" },
+ "i32.gt_u": { "category": "comparison", "value": 75, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Above" },
+ "i32.ge_u": { "category": "comparison", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "AboveEqual" },
+ "i32.clz": { "category": "arithmetic", "value": 103, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "Clz" },
+ "i32.ctz": { "category": "arithmetic", "value": 104, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
+ "i32.popcnt": { "category": "arithmetic", "value": 105, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
+ "i32.eqz": { "category": "comparison", "value": 69, "return": ["bool"], "parameter": ["i32"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
+ "i64.add": { "category": "arithmetic", "value": 124, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Add" },
+ "i64.sub": { "category": "arithmetic", "value": 125, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Sub" },
+ "i64.mul": { "category": "arithmetic", "value": 126, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mul" },
+ "i64.div_s": { "category": "arithmetic", "value": 127, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Div" },
+ "i64.div_u": { "category": "arithmetic", "value": 128, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
+ "i64.rem_s": { "category": "arithmetic", "value": 129, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mod" },
+ "i64.rem_u": { "category": "arithmetic", "value": 130, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "UDiv" },
+ "i64.and": { "category": "arithmetic", "value": 131, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitAnd" },
+ "i64.or": { "category": "arithmetic", "value": 132, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitOr" },
+ "i64.xor": { "category": "arithmetic", "value": 133, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitXor" },
+ "i64.shl": { "category": "arithmetic", "value": 134, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Shl" },
+ "i64.shr_u": { "category": "arithmetic", "value": 136, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "SShr" },
+ "i64.shr_s": { "category": "arithmetic", "value": 135, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "ZShr" },
+ "i64.rotr": { "category": "arithmetic", "value": 138, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotR" },
+ "i64.rotl": { "category": "arithmetic", "value": 137, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotL" },
+ "i64.eq": { "category": "comparison", "value": 81, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Equal" },
+ "i64.ne": { "category": "comparison", "value": 82, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "NotEqual" },
+ "i64.lt_s": { "category": "comparison", "value": 83, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessThan" },
+ "i64.le_s": { "category": "comparison", "value": 87, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessEqual" },
+ "i64.lt_u": { "category": "comparison", "value": 84, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Below" },
+ "i64.le_u": { "category": "comparison", "value": 88, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BelowEqual" },
+ "i64.gt_s": { "category": "comparison", "value": 85, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterThan" },
+ "i64.ge_s": { "category": "comparison", "value": 89, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterEqual" },
+ "i64.gt_u": { "category": "comparison", "value": 86, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Above" },
+ "i64.ge_u": { "category": "comparison", "value": 90, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "AboveEqual" },
+ "i64.clz": { "category": "arithmetic", "value": 121, "return": ["i64"], "parameter": ["i64"], "immediate": [], "b3op": "Clz" },
+ "i64.ctz": { "category": "arithmetic", "value": 122, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
+ "i64.popcnt": { "category": "arithmetic", "value": 123, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
+ "i64.eqz": { "category": "comparison", "value": 80, "return": ["bool"], "parameter": ["i64"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
+ "f32.add": { "category": "arithmetic", "value": 146, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Add" },
+ "f32.sub": { "category": "arithmetic", "value": 147, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Sub" },
+ "f32.mul": { "category": "arithmetic", "value": 148, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Mul" },
+ "f32.div": { "category": "arithmetic", "value": 149, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Div" },
+ "f32.min": { "category": "arithmetic", "value": 150, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
+ "f32.max": { "category": "arithmetic", "value": 151, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
+ "f32.abs": { "category": "arithmetic", "value": 139, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Abs" },
+ "f32.neg": { "category": "arithmetic", "value": 140, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Neg" },
+ "f32.copysign": { "category": "arithmetic", "value": 152, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i32(0x80000000)), BitAnd(BitwiseCast(@0), i32(0x7fffffff))))" },
+ "f32.ceil": { "category": "arithmetic", "value": 141, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Ceil" },
+ "f32.floor": { "category": "arithmetic", "value": 142, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Floor" },
+ "f32.trunc": { "category": "arithmetic", "value": 143, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
+ "f32.nearest": { "category": "arithmetic", "value": 144, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
+ "f32.sqrt": { "category": "arithmetic", "value": 145, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Sqrt" },
+ "f32.eq": { "category": "comparison", "value": 91, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Equal" },
+ "f32.ne": { "category": "comparison", "value": 92, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "NotEqual" },
+ "f32.lt": { "category": "comparison", "value": 93, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessThan" },
+ "f32.le": { "category": "comparison", "value": 95, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessEqual" },
+ "f32.gt": { "category": "comparison", "value": 94, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterThan" },
+ "f32.ge": { "category": "comparison", "value": 96, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterEqual" },
+ "f64.add": { "category": "arithmetic", "value": 160, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Add" },
+ "f64.sub": { "category": "arithmetic", "value": 161, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Sub" },
+ "f64.mul": { "category": "arithmetic", "value": 162, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Mul" },
+ "f64.div": { "category": "arithmetic", "value": 163, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Div" },
+ "f64.min": { "category": "arithmetic", "value": 164, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @0, @1)" },
+ "f64.max": { "category": "arithmetic", "value": 165, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(LessThan(@0, @1), @1, @0)" },
+ "f64.abs": { "category": "arithmetic", "value": 153, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Abs" },
+ "f64.neg": { "category": "arithmetic", "value": 154, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Neg" },
+ "f64.copysign": { "category": "arithmetic", "value": 166, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "BitwiseCast(BitOr(BitAnd(BitwiseCast(@1), i64(0x8000000000000000)), BitAnd(BitwiseCast(@0), i64(0x7fffffffffffffff))))" },
+ "f64.ceil": { "category": "arithmetic", "value": 155, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Ceil" },
+ "f64.floor": { "category": "arithmetic", "value": 156, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Floor" },
+ "f64.trunc": { "category": "arithmetic", "value": 157, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
+ "f64.nearest": { "category": "arithmetic", "value": 158, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
+ "f64.sqrt": { "category": "arithmetic", "value": 159, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Sqrt" },
+ "f64.eq": { "category": "comparison", "value": 97, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Equal" },
+ "f64.ne": { "category": "comparison", "value": 98, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "NotEqual" },
+ "f64.lt": { "category": "comparison", "value": 99, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessThan" },
+ "f64.le": { "category": "comparison", "value": 101, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessEqual" },
+ "f64.gt": { "category": "comparison", "value": 100, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterThan" },
+ "f64.ge": { "category": "comparison", "value": 102, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterEqual" },
+ "i32.trunc_s/f32": { "category": "conversion", "value": 168, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
+ "i32.trunc_s/f64": { "category": "conversion", "value": 170, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
+ "i32.trunc_u/f32": { "category": "conversion", "value": 169, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
+ "i32.trunc_u/f64": { "category": "conversion", "value": 171, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
+ "i32.wrap/i64": { "category": "conversion", "value": 167, "return": ["i32"], "parameter": ["i64"], "immediate": [] },
+ "i64.trunc_s/f32": { "category": "conversion", "value": 174, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
+ "i64.trunc_s/f64": { "category": "conversion", "value": 176, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
+ "i64.trunc_u/f32": { "category": "conversion", "value": 175, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
+ "i64.trunc_u/f64": { "category": "conversion", "value": 177, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
+ "i64.extend_s/i32": { "category": "conversion", "value": 172, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "SExt32" },
+ "i64.extend_u/i32": { "category": "conversion", "value": 173, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "ZExt32" },
+ "f32.convert_s/i32": { "category": "conversion", "value": 178, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF" },
+ "f32.convert_u/i32": { "category": "conversion", "value": 179, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF(ZExt32(@0))" },
+ "f32.convert_s/i64": { "category": "conversion", "value": 180, "return": ["f32"], "parameter": ["i64"], "immediate": [], "b3op": "IToF" },
+ "f32.convert_u/i64": { "category": "conversion", "value": 181, "return": ["f32"], "parameter": ["i64"], "immediate": [] },
+ "f32.demote/f64": { "category": "conversion", "value": 182, "return": ["f32"], "parameter": ["f64"], "immediate": [], "b3op": "DoubleToFloat"},
+ "f32.reinterpret/i32": { "category": "conversion", "value": 190, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "BitwiseCast" },
+ "f64.convert_s/i32": { "category": "conversion", "value": 183, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD" },
+ "f64.convert_u/i32": { "category": "conversion", "value": 184, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD(ZExt32(@0))" },
+ "f64.convert_s/i64": { "category": "conversion", "value": 185, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "IToD" },
+ "f64.convert_u/i64": { "category": "conversion", "value": 186, "return": ["f64"], "parameter": ["i64"], "immediate": [] },
+ "f64.promote/f32": { "category": "conversion", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"},
+ "f64.reinterpret/i64": { "category": "conversion", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" },
+ "i32.reinterpret/f32": { "category": "conversion", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" },
+ "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }
</ins><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>