diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-10-24 23:27:49 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-10-24 23:27:49 +0000 |
commit | 3acb187d95a8cbe1941459a9c6fb62cc5d44b1e5 (patch) | |
tree | 450f11c44d1568ef9e344e5163d34bc4d305250b /llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td | |
parent | 8b38ffaa986a06a6bdbd243b26eacc46ce9e5889 (diff) | |
download | bcm5719-llvm-3acb187d95a8cbe1941459a9c6fb62cc5d44b1e5.tar.gz bcm5719-llvm-3acb187d95a8cbe1941459a9c6fb62cc5d44b1e5.zip |
[WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.
This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.
llvm-svn: 285040
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td index 7ff5bbdcd48..1146431e6b7 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td @@ -65,13 +65,13 @@ def BLOCK : I<(outs), (ins Signature:$sig), [], "block \t$sig", 0x02>; def LOOP : I<(outs), (ins Signature:$sig), [], "loop \t$sig", 0x03>; // END_BLOCK and END_LOOP are represented with the same opcode in wasm. -def END_BLOCK : I<(outs), (ins), [], "end_block", 0x0f>; -def END_LOOP : I<(outs), (ins), [], "end_loop", 0x0f>; +def END_BLOCK : I<(outs), (ins), [], "end_block", 0x0b>; +def END_LOOP : I<(outs), (ins), [], "end_loop", 0x0b>; } // Uses = [VALUE_STACK], Defs = [VALUE_STACK] multiclass RETURN<WebAssemblyRegClass vt> { def RETURN_#vt : I<(outs), (ins vt:$val), [(WebAssemblyreturn vt:$val)], - "return \t$val">; + "return \t$val", 0x0f>; // Equivalent to RETURN_#vt, for use at the end of a function when wasm // semantics return by falling off the end of the block. let isCodeGenOnly = 1 in @@ -81,7 +81,7 @@ multiclass RETURN<WebAssemblyRegClass vt> { multiclass SIMD_RETURN<ValueType vt> { def RETURN_#vt : SIMD_I<(outs), (ins V128:$val), [(WebAssemblyreturn (vt V128:$val))], - "return \t$val">; + "return \t$val", 0x0f>; // Equivalent to RETURN_#vt, for use at the end of a function when wasm // semantics return by falling off the end of the block. let isCodeGenOnly = 1 in @@ -100,14 +100,14 @@ let isReturn = 1 in { defm : SIMD_RETURN<v4i32>; defm : SIMD_RETURN<v4f32>; - def RETURN_VOID : I<(outs), (ins), [(WebAssemblyreturn)], "return">; + def RETURN_VOID : I<(outs), (ins), [(WebAssemblyreturn)], "return", 0x0f>; // This is to RETURN_VOID what FALLTHROUGH_RETURN_#vt is to RETURN_#vt. let isCodeGenOnly = 1 in def FALLTHROUGH_RETURN_VOID : I<(outs), (ins), []>; } // isReturn = 1 -def UNREACHABLE : I<(outs), (ins), [(trap)], "unreachable">; +def UNREACHABLE : I<(outs), (ins), [(trap)], "unreachable", 0x00>; } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 |