diff options
author | Dan Gohman <dan433584@gmail.com> | 2017-02-02 19:29:44 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2017-02-02 19:29:44 +0000 |
commit | e56a9ab847a6ec222655c0bcbf666f93bd4f5986 (patch) | |
tree | 7af7fc339d9f713e8423637db2e23808ca92f87e /lib/Target/WebAssembly/WebAssemblyInstrInfo.td | |
parent | 53438cdceea85d3245294206fe69da5c7969f10a (diff) |
[WebAssembly] Add instruction definitions for drop and get/set_global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/WebAssembly/WebAssemblyInstrInfo.td')
-rw-r--r-- | lib/Target/WebAssembly/WebAssemblyInstrInfo.td | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/lib/Target/WebAssembly/WebAssemblyInstrInfo.td index dcfd1a42c6a..79472cd8e48 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -74,6 +74,9 @@ def bb_op : Operand<OtherVT>; let OperandType = "OPERAND_LOCAL" in def local_op : Operand<i32>; +let OperandType = "OPERAND_GLOBAL" in +def global_op : Operand<i32>; + let OperandType = "OPERAND_I32IMM" in def i32imm_op : Operand<i32>; @@ -178,6 +181,18 @@ let hasSideEffects = 0 in { def TEE_LOCAL_#vt : I<(outs vt:$res), (ins local_op:$local, vt:$src), [], "tee_local\t$res, $local, $src", 0x22>; + // Unused values must be dropped in some contexts. + def DROP_#vt : I<(outs), (ins vt:$src), [], + "drop\t$src", 0x1a>; + + let mayLoad = 1 in + def GET_GLOBAL_#vt : I<(outs vt:$res), (ins global_op:$local), [], + "get_global\t$res, $local", 0x23>; + + let mayStore = 1 in + def SET_GLOBAL_#vt : I<(outs), (ins global_op:$local, vt:$src), [], + "set_global\t$local, $src", 0x24>; + } // hasSideEffects = 0 } defm : LOCAL<I32>; |