1 //===- WebAssemblyInstrCall.td-WebAssembly Call codegen support -*- tablegen -*-
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief WebAssembly Call operand code-gen constructs.
13 //===----------------------------------------------------------------------===//
15 // The call sequence start/end LLVM-isms isn't useful to WebAssembly since it's
17 let isCodeGenOnly = 1 in {
18 def : I<(outs), (ins i64imm:$amt),
19 [(WebAssemblycallseq_start timm:$amt)]>;
20 def : I<(outs), (ins i64imm:$amt1, i64imm:$amt2),
21 [(WebAssemblycallseq_end timm:$amt1, timm:$amt2)]>;
22 } // isCodeGenOnly = 1
24 multiclass CALL<WebAssemblyRegClass vt> {
25 def CALL_#vt : I<(outs vt:$dst), (ins global:$callee, variable_ops),
26 [(set vt:$dst, (WebAssemblycall1 (WebAssemblywrapper tglobaladdr:$callee)))],
27 "call \t$dst, $callee">;
28 def CALL_INDIRECT_#vt : I<(outs vt:$dst), (ins I32:$callee, variable_ops),
29 [(set vt:$dst, (WebAssemblycall1 I32:$callee))],
30 "call_indirect\t$dst, $callee">;
32 let Uses = [SP32, SP64], isCall = 1 in {
38 def CALL_VOID : I<(outs), (ins global:$callee, variable_ops),
39 [(WebAssemblycall0 (WebAssemblywrapper tglobaladdr:$callee))],
41 def CALL_INDIRECT_VOID : I<(outs), (ins I32:$callee, variable_ops),
42 [(WebAssemblycall0 I32:$callee)],
43 "call_indirect\t$callee">;
44 } // Uses = [SP32,SP64], isCall = 1