1 // WebAssemblyInstrInfo.td-Describe the WebAssembly Instructions-*- 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 Instruction definitions.
13 //===----------------------------------------------------------------------===//
15 //===----------------------------------------------------------------------===//
16 // WebAssembly Instruction Predicate Definitions.
17 //===----------------------------------------------------------------------===//
19 def HasAddr32 : Predicate<"!Subtarget->hasAddr64()">;
20 def HasAddr64 : Predicate<"Subtarget->hasAddr64()">;
21 def HasSIMD128 : Predicate<"Subtarget->hasSIMD128()">,
22 AssemblerPredicate<"FeatureSIMD128", "simd128">;
24 //===----------------------------------------------------------------------===//
25 // WebAssembly-specific DAG Node Types.
26 //===----------------------------------------------------------------------===//
28 def SDT_WebAssemblyArgument : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
29 def SDT_WebAssemblyReturn : SDTypeProfile<0, 1, []>;
31 //===----------------------------------------------------------------------===//
32 // WebAssembly-specific DAG Nodes.
33 //===----------------------------------------------------------------------===//
35 def WebAssemblyargument : SDNode<"WebAssemblyISD::ARGUMENT",
36 SDT_WebAssemblyArgument>;
37 def WebAssemblyreturn : SDNode<"WebAssemblyISD::RETURN",
38 SDT_WebAssemblyReturn,
39 [SDNPHasChain, SDNPSideEffect]>;
41 //===----------------------------------------------------------------------===//
42 // WebAssembly-specific Operands.
43 //===----------------------------------------------------------------------===//
46 * TODO(jfb): Add the following.
48 * get_local: read the current value of a local variable
49 * set_local: set the current value of a local variable
52 //===----------------------------------------------------------------------===//
53 // WebAssembly Instruction Format Definitions.
54 //===----------------------------------------------------------------------===//
56 include "WebAssemblyInstrFormats.td"
58 def ARGUMENT : I<(outs Int32:$res), (ins i32imm:$argno),
59 [(set Int32:$res, (WebAssemblyargument timm:$argno))]>;
61 //===----------------------------------------------------------------------===//
62 // Additional sets of instructions.
63 //===----------------------------------------------------------------------===//
65 include "WebAssemblyInstrMemory.td"
66 include "WebAssemblyInstrCall.td"
67 include "WebAssemblyInstrControl.td"
68 include "WebAssemblyInstrInteger.td"
69 include "WebAssemblyInstrFloat.td"
70 include "WebAssemblyInstrConv.td"
71 include "WebAssemblyInstrAtomics.td"
72 include "WebAssemblyInstrSIMD.td"