Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
401 lines (400 sloc) 49.5 KB
{
"comment": [
"Serializer/Deserializer for all the structures in",
"Webassembly files.",
"",
"This file has been hand-written, and behaves like",
"a DSL that can run as both a serializer and a deserializer",
"",
"The language comes with following rules:",
"Where there is a type -field in object, there can be",
" a fn -field which is shorthand for type:{fn, type, ...}",
"List in a place of a type is a record sequence.",
" convert it into an object",
"{fn:datablock, type} is data annotated with varuint32 field.",
" The length field must match the size in bytes.",
"{fn:optional, type} is optional field whose presence marked",
" with varuint1 field.",
"{fn:list, type} is a list, the count denoted with varuint32",
"{fn:table, type, values:[{value,name}]} is a type with",
" a lookup table.",
"{fn:select, type, dst, choice:[{match,type}]}",
" A dispatch table. if the type in dispatch is",
" an object, the dst tells which field identifies",
" what kind of object this is.",
"{flatten:true} in above objects interprets the type",
" record to be flattened into a single object",
"",
"Inside an object within a record:",
" type: match to this field",
" name: store to this name in the record",
" value: must have this value",
" bits:{name:pattern} indicates the absence or presence",
" of a field.",
"",
"String as a type indicates a type from the types -table",
" or then one of the following:",
" bytes: byte array object",
" utf8: string object",
" varuintN: unsigned leb128 encoded object limited to N bits",
" varintN: signed leb128 encoded object limited to N bits",
" uintN: unsigned integer object",
" init_expr: instruction list ending up to 0x0b",
" expr: full instruction list that can contain blocks",
"",
"Integers are treated as little endian",
"",
"Usage: implement the interpreter for serializer/deserializer",
" start by evaluating the preamble,",
" if you are serializing, sort sections by id field",
" id encoded as varuint7",
" section size in bytes, starting after this point",
" encoded as varuint32",
" if the id == 0, section name encoded as utf8",
" rest of the section encoded from the sections -table",
"",
"Opcode table is required for parsing 'expr' and 'init_expr' reliably",
" therefore it is attached along this file. The instructions are provided",
" as a list, {name, meta, ...}",
"",
"The opcode table was helpfully provided by webkit project",
" so there is a separate source link for opcode list",
"",
"During decoding instructions",
" if you hit 'block', 'loop', 'if', increment.",
" if you hit 'end', decrement.",
" on 0 and 'end', stop.",
"",
"During encoding instructions",
" if you hit 'block', 'loop', 'if', increment.",
" if you hit 'end', decrement.",
" assert that result is 0, add 'end', stop.",
"",
"This file is available for your use, however you like.",
" although, unless you want to maintain this, keep the *source_url",
" entries to denote the point of origin",
"",
"Before using the file, check the version of this file",
" the version changes if the DSL changes"
],
"source_url": "https://github.com/cheery/lever/tree/master/lib/webassembly-1.json",
"opcode_source_url": "https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/wasm/wasm.json",
"version": "2017-4-12.decomposing-kitty-MVP",
"preamble": [
{"type": "uint32", "value": 1836278016},
{"type": "uint32", "value": 1, "name":"version"}
],
"sections": {
"type": {"id":1, "fn":"list", "type":"func_type"},
"import": {"id":2, "fn":"list", "type":"import_entry"},
"function": {"id":3, "fn":"list", "type":"varuint32"},
"table": {"id":4, "fn":"list", "type":[
{
"type":"elem_type",
"name":"element_type",
"value":"anyfunc"
},
{"type":"resizable_limits", "name":"limits"}
]},
"memory": {"id":5, "fn":"list", "type":[
{"type":"resizable_limits", "name":"limits"}
]},
"global": {"id":6, "fn":"list", "type":[
{"type":"value_type", "name":"content_type"},
{"type":"varuint1", "name":"mutability"},
{"type":"init_expr", "name":"init"}
]},
"export": {"id":7, "fn":"list", "type":[
{"type":"utf8", "name":"field"},
{"type":"external_kind", "name":"kind"},
{"type":"varuint32", "name":"index"}
]},
"start": {"id":8, "type":"varuint32"},
"element": {"id":9, "fn":"list", "type":[
{"type":"varuint32", "name":"index"},
{"type":"init_expr", "name":"offset"},
{"fn":"list", "type":"varuint32", "name":"elems"}
]},
"code": {"id":10, "fn":"list", "type":{
"fn":"datablock",
"type":[
{"fn":"list", "type":"local_entry", "name":"locals"},
{"type":"expr", "name":"body"}
]}
},
"data": {"id":11, "fn":"list", "type":[
{"type":"varuint32", "name":"index"},
{"type":"init_expr", "name":"offset"},
{"type":"bytes", "name":"data"}
]}
},
"types": {
"func_type": [
{"type":"language_type", "name":"form", "value":"func"},
{"fn":"list", "type":"value_type", "name":"argtypes"},
{"fn":"optional", "type":"value_type", "name":"restype"}
],
"import_entry": [
{"type":"utf8", "name":"module"},
{"type":"utf8", "name":"field"},
{
"flatten":true,
"dst":"kind",
"fn":"select",
"type":"external_kind",
"choice":[
{"match":"function", "type":[
{"type":"varuint32", "name":"index"}
]},
{"match":"table", "type":[
{
"type":"elem_type",
"name":"element_type",
"value":"anyfunc"
},
{"type":"resizable_limits", "name":"limits"}
]},
{"match":"memory", "type":[
{"type":"resizable_limits", "name":"limits"}
]},
{"match":"global", "type":[
{"type":"value_type", "name":"content_type"},
{"type":"varuint1", "name":"mutability"}
]}
]
}
],
"external_kind": {"fn":"table", "type":"uint8", "values":[
{"value":0, "name":"function"},
{"value":1, "name":"table"},
{"value":2, "name":"memory"},
{"value":3, "name":"global"}
]},
"resizable_limits": [
{"type":"varuint1", "bits":{"maximum": 1}},
{"type":"varuint32", "name":"initial"},
{"type":"varuint32", "name":"maximum"}
],
"local_entry": [
{"type":"varuint32", "name":"count"},
{"type":"value_type", "name":"type"}
],
"value_type": {"fn":"table", "type":"varint7", "values":[
{"value":-1, "name":"i32"},
{"value":-2, "name":"i64"},
{"value":-3, "name":"f32"},
{"value":-4, "name":"f64"}
]},
"block_type": {"fn":"table", "type":"varint7", "values":[
{"value":-1, "name":"i32"},
{"value":-2, "name":"i64"},
{"value":-3, "name":"f32"},
{"value":-64, "name":null, "comment":"called 'void' elsewhere"}
]},
"elem_type": {"fn":"table", "type":"varint7", "values":[
{"value":-16, "name":"anyfunc"}
]},
"language_type": {"fn":"table", "type":"varint7", "values":[
{"value":-1, "name":"i32"},
{"value":-2, "name":"i64"},
{"value":-3, "name":"f32"},
{"value":-4, "name":"f64"},
{"value":-16, "name":"anyfunc"},
{"value":-32, "name":"func"},
{"value":-64, "name":null, "comment":"called 'void' elsewhere"}
]}
},
"opcodes": {
"unreachable": { "category": "control", "value": 0, "return": [], "parameter": [], "immediate": [], "description": "trap immediately" },
"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": [
{
"fn":"list",
"type":"varuint32",
"name":"targets",
"description": "target entries that indicate an outer block or loop to which to break"
},
{
"type":"varuint32",
"name":"default_target",
"description": "an outer block or loop to which to break in the default case"
}
],
"description": "branch table control flow construct"
},
"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", "name": "const", "value": 65, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
"i64.const": { "category": "special", "name": "const", "value": 66, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
"f64.const": { "category": "special", "name": "const", "value": 68, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "double"}], "description": "a constant value interpreted as f64" },
"f32.const": { "category": "special", "name": "const", "value": 67, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "float"}], "description": "a constant value interpreted as f32" },
"get_local": { "category": "special", "value": 32, "return": ["any"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
"set_local": { "category": "special", "value": 33, "return": [], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
"tee_local": { "category": "special", "value": 34, "return": ["any"], "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": ["any"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
"set_global": { "category": "special", "value": 36, "return": [], "parameter": ["any"], "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"}, {"name": "reserved", "type": "varuint1"}], "description": "call a function indirect with an expected signature" },
"i32.load8_s": { "category": "memory", "name": "load8_s", "value": 44, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i32.load8_u": { "category": "memory", "name": "load8_u", "value": 45, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i32.load16_s": { "category": "memory", "name": "load16_s", "value": 46, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i32.load16_u": { "category": "memory", "name": "load16_u", "value": 47, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load8_s": { "category": "memory", "name": "load8_s", "value": 48, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load8_u": { "category": "memory", "name": "load8_u", "value": 49, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load16_s": { "category": "memory", "name": "load16_s", "value": 50, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load16_u": { "category": "memory", "name": "load16_u", "value": 51, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load32_s": { "category": "memory", "name": "load32_s", "value": 52, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load32_u": { "category": "memory", "name": "load32_u", "value": 53, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i32.load": { "category": "memory", "name": "load32", "value": 40, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i64.load": { "category": "memory", "name": "load64", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"f32.load": { "category": "memory", "name": "load32", "value": 42, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"f64.load": { "category": "memory", "name": "load64", "value": 43, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
"i32.store8": { "category": "memory", "name": "store8", "value": 58, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i32.store16": { "category": "memory", "name": "store16", "value": 59, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i64.store8": { "category": "memory", "name": "store8", "value": 60, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i64.store16": { "category": "memory", "name": "store16", "value": 61, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i64.store32": { "category": "memory", "name": "store32", "value": 62, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i32.store": { "category": "memory", "name": "store32", "value": 54, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"i64.store": { "category": "memory", "name": "store64", "value": 55, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"f32.store": { "category": "memory", "name": "store32", "value": 56, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"f64.store": { "category": "memory", "name": "store64", "value": 57, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
"current_memory": { "category": "operation", "name": "current_memory", "value": 63, "return": ["size"], "parameter": [], "immediate": [{"name": "flags", "type": "varuint32"}], "description": "query the size of memory" },
"grow_memory": { "category": "operation", "name": "grow_memory", "value": 64, "return": ["size"], "parameter": ["size"], "immediate": [{"name": "flags", "type": "varuint32"}], "description": "grow the size of memory" },
"i32.add": { "category": "arithmetic", "name": "add", "value": 106, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Add" },
"i32.sub": { "category": "arithmetic", "name": "sub", "value": 107, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Sub" },
"i32.mul": { "category": "arithmetic", "name": "mul", "value": 108, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Mul" },
"i32.div_s": { "category": "arithmetic", "name": "div_s", "value": 109, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [] },
"i32.div_u": { "category": "arithmetic", "name": "div_u", "value": 110, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [] },
"i32.rem_s": { "category": "arithmetic", "name": "rem_s", "value": 111, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [] },
"i32.rem_u": { "category": "arithmetic", "name": "rem_u", "value": 112, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [] },
"i32.and": { "category": "arithmetic", "name": "and", "value": 113, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitAnd" },
"i32.or": { "category": "arithmetic", "name": "or", "value": 114, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitOr" },
"i32.xor": { "category": "arithmetic", "name": "xor", "value": 115, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BitXor" },
"i32.shl": { "category": "arithmetic", "name": "shl", "value": 116, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Shl" },
"i32.shr_u": { "category": "arithmetic", "name": "shr_u", "value": 118, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "ZShr" },
"i32.shr_s": { "category": "arithmetic", "name": "shr_s", "value": 117, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "SShr" },
"i32.rotr": { "category": "arithmetic", "name": "rotr", "value": 120, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotR" },
"i32.rotl": { "category": "arithmetic", "name": "rotl", "value": 119, "return": ["i32"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "RotL" },
"i32.eq": { "category": "comparison", "name": "eq", "value": 70, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Equal" },
"i32.ne": { "category": "comparison", "name": "ne", "value": 71, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "NotEqual" },
"i32.lt_s": { "category": "comparison", "name": "lt_s", "value": 72, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessThan" },
"i32.le_s": { "category": "comparison", "name": "le_s", "value": 76, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "LessEqual" },
"i32.lt_u": { "category": "comparison", "name": "lt_u", "value": 73, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Below" },
"i32.le_u": { "category": "comparison", "name": "le_u", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "BelowEqual" },
"i32.gt_s": { "category": "comparison", "name": "gt_s", "value": 74, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterThan" },
"i32.ge_s": { "category": "comparison", "name": "ge_s", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "GreaterEqual" },
"i32.gt_u": { "category": "comparison", "name": "gt_u", "value": 75, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "Above" },
"i32.ge_u": { "category": "comparison", "name": "ge_u", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "immediate": [], "b3op": "AboveEqual" },
"i32.clz": { "category": "arithmetic", "name": "clz", "value": 103, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "Clz" },
"i32.ctz": { "category": "arithmetic", "name": "ctz", "value": 104, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
"i32.popcnt": { "category": "arithmetic", "name": "popcnt", "value": 105, "return": ["i32"], "parameter": ["i32"], "immediate": [] },
"i32.eqz": { "category": "comparison", "name": "eqz", "value": 69, "return": ["bool"], "parameter": ["i32"], "immediate": [], "b3op": "Equal(i32(0), @0)" },
"i64.add": { "category": "arithmetic", "name": "add", "value": 124, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Add" },
"i64.sub": { "category": "arithmetic", "name": "sub", "value": 125, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Sub" },
"i64.mul": { "category": "arithmetic", "name": "mul", "value": 126, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Mul" },
"i64.div_s": { "category": "arithmetic", "name": "div_s", "value": 127, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [] },
"i64.div_u": { "category": "arithmetic", "name": "div_u", "value": 128, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [] },
"i64.rem_s": { "category": "arithmetic", "name": "rem_s", "value": 129, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [] },
"i64.rem_u": { "category": "arithmetic", "name": "rem_u", "value": 130, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [] },
"i64.and": { "category": "arithmetic", "name": "and", "value": 131, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitAnd" },
"i64.or": { "category": "arithmetic", "name": "or", "value": 132, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitOr" },
"i64.xor": { "category": "arithmetic", "name": "xor", "value": 133, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BitXor" },
"i64.shl": { "category": "arithmetic", "name": "shl", "value": 134, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Shl(@0, Trunc(@1))" },
"i64.shr_u": { "category": "arithmetic", "name": "shr_u", "value": 136, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "ZShr(@0, Trunc(@1))" },
"i64.shr_s": { "category": "arithmetic", "name": "shr_s", "value": 135, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "SShr(@0, Trunc(@1))" },
"i64.rotr": { "category": "arithmetic", "name": "rotr", "value": 138, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotR(@0, Trunc(@1))" },
"i64.rotl": { "category": "arithmetic", "name": "rotl", "value": 137, "return": ["i64"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "RotL(@0, Trunc(@1))" },
"i64.eq": { "category": "comparison", "name": "eq", "value": 81, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Equal" },
"i64.ne": { "category": "comparison", "name": "ne", "value": 82, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "NotEqual" },
"i64.lt_s": { "category": "comparison", "name": "lt_s", "value": 83, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessThan" },
"i64.le_s": { "category": "comparison", "name": "le_s", "value": 87, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "LessEqual" },
"i64.lt_u": { "category": "comparison", "name": "lt_u", "value": 84, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Below" },
"i64.le_u": { "category": "comparison", "name": "le_u", "value": 88, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "BelowEqual" },
"i64.gt_s": { "category": "comparison", "name": "gt_s", "value": 85, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterThan" },
"i64.ge_s": { "category": "comparison", "name": "ge_s", "value": 89, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "GreaterEqual" },
"i64.gt_u": { "category": "comparison", "name": "gt_u", "value": 86, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "Above" },
"i64.ge_u": { "category": "comparison", "name": "ge_u", "value": 90, "return": ["bool"], "parameter": ["i64", "i64"], "immediate": [], "b3op": "AboveEqual" },
"i64.clz": { "category": "arithmetic", "name": "clz", "value": 121, "return": ["i64"], "parameter": ["i64"], "immediate": [], "b3op": "Clz" },
"i64.ctz": { "category": "arithmetic", "name": "ctz", "value": 122, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
"i64.popcnt": { "category": "arithmetic", "name": "popcnt", "value": 123, "return": ["i64"], "parameter": ["i64"], "immediate": [] },
"i64.eqz": { "category": "comparison", "name": "eqz", "value": 80, "return": ["bool"], "parameter": ["i64"], "immediate": [], "b3op": "Equal(i64(0), @0)" },
"f32.add": { "category": "arithmetic", "name": "add", "value": 146, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Add" },
"f32.sub": { "category": "arithmetic", "name": "sub", "value": 147, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Sub" },
"f32.mul": { "category": "arithmetic", "name": "mul", "value": 148, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Mul" },
"f32.div": { "category": "arithmetic", "name": "div", "value": 149, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Div" },
"f32.min": { "category": "arithmetic", "name": "min", "value": 150, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(Equal(@0, @1), BitOr(@0, @1), Select(LessThan(@0, @1), @0, @1))" },
"f32.max": { "category": "arithmetic", "name": "max", "value": 151, "return": ["f32"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Select(Equal(@0, @1), BitAnd(@0, @1), Select(LessThan(@0, @1), @1, @0))" },
"f32.abs": { "category": "arithmetic", "name": "abs", "value": 139, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Abs" },
"f32.neg": { "category": "arithmetic", "name": "neg", "value": 140, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Neg" },
"f32.copysign": { "category": "arithmetic", "name": "copysign", "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", "name": "ceil", "value": 141, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Ceil" },
"f32.floor": { "category": "arithmetic", "name": "floor", "value": 142, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Floor" },
"f32.trunc": { "category": "arithmetic", "name": "trunc", "value": 143, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
"f32.nearest": { "category": "arithmetic", "name": "nearest", "value": 144, "return": ["f32"], "parameter": ["f32"], "immediate": [] },
"f32.sqrt": { "category": "arithmetic", "name": "sqrt", "value": 145, "return": ["f32"], "parameter": ["f32"], "immediate": [], "b3op": "Sqrt" },
"f32.eq": { "category": "comparison", "name": "eq", "value": 91, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "Equal" },
"f32.ne": { "category": "comparison", "name": "ne", "value": 92, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "NotEqual" },
"f32.lt": { "category": "comparison", "name": "lt", "value": 93, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessThan" },
"f32.le": { "category": "comparison", "name": "le", "value": 95, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "LessEqual" },
"f32.gt": { "category": "comparison", "name": "gt", "value": 94, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterThan" },
"f32.ge": { "category": "comparison", "name": "ge", "value": 96, "return": ["bool"], "parameter": ["f32", "f32"], "immediate": [], "b3op": "GreaterEqual" },
"f64.add": { "category": "arithmetic", "name": "add", "value": 160, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Add" },
"f64.sub": { "category": "arithmetic", "name": "sub", "value": 161, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Sub" },
"f64.mul": { "category": "arithmetic", "name": "mul", "value": 162, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Mul" },
"f64.div": { "category": "arithmetic", "name": "div", "value": 163, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Div" },
"f64.min": { "category": "arithmetic", "name": "min", "value": 164, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(Equal(@0, @1), BitOr(@0, @1), Select(LessThan(@0, @1), @0, @1))" },
"f64.max": { "category": "arithmetic", "name": "max", "value": 165, "return": ["f64"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Select(Equal(@0, @1), BitAnd(@0, @1), Select(LessThan(@0, @1), @1, @0))" },
"f64.abs": { "category": "arithmetic", "name": "abs", "value": 153, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Abs" },
"f64.neg": { "category": "arithmetic", "name": "neg", "value": 154, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Neg" },
"f64.copysign": { "category": "arithmetic", "name": "copysign", "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", "name": "ceil", "value": 155, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Ceil" },
"f64.floor": { "category": "arithmetic", "name": "floor", "value": 156, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Floor" },
"f64.trunc": { "category": "arithmetic", "name": "trunc", "value": 157, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
"f64.nearest": { "category": "arithmetic", "name": "nearest", "value": 158, "return": ["f64"], "parameter": ["f64"], "immediate": [] },
"f64.sqrt": { "category": "arithmetic", "name": "sqrt", "value": 159, "return": ["f64"], "parameter": ["f64"], "immediate": [], "b3op": "Sqrt" },
"f64.eq": { "category": "comparison", "name": "eq", "value": 97, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "Equal" },
"f64.ne": { "category": "comparison", "name": "ne", "value": 98, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "NotEqual" },
"f64.lt": { "category": "comparison", "name": "lt", "value": 99, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessThan" },
"f64.le": { "category": "comparison", "name": "le", "value": 101, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "LessEqual" },
"f64.gt": { "category": "comparison", "name": "gt", "value": 100, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterThan" },
"f64.ge": { "category": "comparison", "name": "ge", "value": 102, "return": ["bool"], "parameter": ["f64", "f64"], "immediate": [], "b3op": "GreaterEqual" },
"i32.trunc_s/f32": { "category": "conversion", "name": "trunc_s", "value": 168, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
"i32.trunc_s/f64": { "category": "conversion", "name": "trunc_s", "value": 170, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
"i32.trunc_u/f32": { "category": "conversion", "name": "trunc_u", "value": 169, "return": ["i32"], "parameter": ["f32"], "immediate": [] },
"i32.trunc_u/f64": { "category": "conversion", "name": "trunc_u", "value": 171, "return": ["i32"], "parameter": ["f64"], "immediate": [] },
"i32.wrap/i64": { "category": "conversion", "name": "wrap", "value": 167, "return": ["i32"], "parameter": ["i64"], "immediate": [], "b3op": "Trunc" },
"i64.trunc_s/f32": { "category": "conversion", "name": "trunc_s", "value": 174, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
"i64.trunc_s/f64": { "category": "conversion", "name": "trunc_s", "value": 176, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
"i64.trunc_u/f32": { "category": "conversion", "name": "trunc_u", "value": 175, "return": ["i64"], "parameter": ["f32"], "immediate": [] },
"i64.trunc_u/f64": { "category": "conversion", "name": "trunc_u", "value": 177, "return": ["i64"], "parameter": ["f64"], "immediate": [] },
"i64.extend_s/i32": { "category": "conversion", "name": "extend_s", "value": 172, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "SExt32" },
"i64.extend_u/i32": { "category": "conversion", "name": "extend_u", "value": 173, "return": ["i64"], "parameter": ["i32"], "immediate": [], "b3op": "ZExt32" },
"f32.convert_s/i32": { "category": "conversion", "name": "convert_s", "value": 178, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF" },
"f32.convert_u/i32": { "category": "conversion", "name": "convert_u", "value": 179, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "IToF(ZExt32(@0))" },
"f32.convert_s/i64": { "category": "conversion", "name": "convert_s", "value": 180, "return": ["f32"], "parameter": ["i64"], "immediate": [], "b3op": "IToF" },
"f32.convert_u/i64": { "category": "conversion", "name": "convert_u", "value": 181, "return": ["f32"], "parameter": ["i64"], "immediate": [] },
"f32.demote/f64": { "category": "conversion", "name": "demote", "value": 182, "return": ["f32"], "parameter": ["f64"], "immediate": [], "b3op": "DoubleToFloat"},
"f32.reinterpret/i32": { "category": "conversion", "name": "reinterpret", "value": 190, "return": ["f32"], "parameter": ["i32"], "immediate": [], "b3op": "BitwiseCast" },
"f64.convert_s/i32": { "category": "conversion", "name": "convert_s", "value": 183, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD" },
"f64.convert_u/i32": { "category": "conversion", "name": "convert_u", "value": 184, "return": ["f64"], "parameter": ["i32"], "immediate": [], "b3op": "IToD(ZExt32(@0))" },
"f64.convert_s/i64": { "category": "conversion", "name": "convert_s", "value": 185, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "IToD" },
"f64.convert_u/i64": { "category": "conversion", "name": "convert_u", "value": 186, "return": ["f64"], "parameter": ["i64"], "immediate": [] },
"f64.promote/f32": { "category": "conversion", "name": "promote", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"},
"f64.reinterpret/i64": { "category": "conversion", "name": "reinterpret", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" },
"i32.reinterpret/f32": { "category": "conversion", "name": "reinterpret", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" },
"i64.reinterpret/f64": { "category": "conversion", "name": "reinterpret", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }
}
}