blob: 40a8f6089c2afa1dc2df2be476a9dafce9b0121d [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001// WebAssemblyInstrInfo.td-Describe the WebAssembly Instructions-*- tablegen -*-
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Dan Gohman10e730a2015-06-29 23:51:55 +00006//
7//===----------------------------------------------------------------------===//
JF Bastien5ca0bac2015-07-10 18:23:10 +00008///
9/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000010/// WebAssembly Instruction definitions.
JF Bastien5ca0bac2015-07-10 18:23:10 +000011///
Dan Gohman10e730a2015-06-29 23:51:55 +000012//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// WebAssembly Instruction Predicate Definitions.
16//===----------------------------------------------------------------------===//
17
Sam Clegg492f7522019-03-26 19:46:15 +000018def IsPIC : Predicate<"TM.isPositionIndependent()">;
19def IsNotPIC : Predicate<"!TM.isPositionIndependent()">;
20
JF Bastien03855df2015-07-01 23:41:25 +000021def HasAddr32 : Predicate<"!Subtarget->hasAddr64()">;
Thomas Lively88058d42019-01-31 21:02:19 +000022
JF Bastien03855df2015-07-01 23:41:25 +000023def HasAddr64 : Predicate<"Subtarget->hasAddr64()">;
Thomas Lively88058d42019-01-31 21:02:19 +000024
25def HasSIMD128 :
26 Predicate<"Subtarget->hasSIMD128()">,
27 AssemblerPredicate<"FeatureSIMD128", "simd128">;
28
Thomas Lively64a39a12019-01-10 22:32:11 +000029def HasUnimplementedSIMD128 :
30 Predicate<"Subtarget->hasUnimplementedSIMD128()">,
31 AssemblerPredicate<"FeatureUnimplementedSIMD128", "unimplemented-simd128">;
Thomas Lively88058d42019-01-31 21:02:19 +000032
33def HasAtomics :
34 Predicate<"Subtarget->hasAtomics()">,
35 AssemblerPredicate<"FeatureAtomics", "atomics">;
36
Dan Gohmancdd48b82017-11-28 01:13:40 +000037def HasNontrappingFPToInt :
38 Predicate<"Subtarget->hasNontrappingFPToInt()">,
Thomas Lively88058d42019-01-31 21:02:19 +000039 AssemblerPredicate<"FeatureNontrappingFPToInt", "nontrapping-fptoint">;
40
Dan Gohmancdd48b82017-11-28 01:13:40 +000041def NotHasNontrappingFPToInt :
42 Predicate<"!Subtarget->hasNontrappingFPToInt()">,
Thomas Lively88058d42019-01-31 21:02:19 +000043 AssemblerPredicate<"!FeatureNontrappingFPToInt", "nontrapping-fptoint">;
44
Dan Gohman5d2b9352018-01-19 17:16:24 +000045def HasSignExt :
46 Predicate<"Subtarget->hasSignExt()">,
Thomas Lively88058d42019-01-31 21:02:19 +000047 AssemblerPredicate<"FeatureSignExt", "sign-ext">;
48
Dan Gohman5d2b9352018-01-19 17:16:24 +000049def NotHasSignExt :
50 Predicate<"!Subtarget->hasSignExt()">,
Thomas Lively88058d42019-01-31 21:02:19 +000051 AssemblerPredicate<"!FeatureSignExt", "sign-ext">;
JF Bastien03855df2015-07-01 23:41:25 +000052
Heejin Ahn9386bde2018-02-24 00:40:50 +000053def HasExceptionHandling :
54 Predicate<"Subtarget->hasExceptionHandling()">,
Thomas Lively88058d42019-01-31 21:02:19 +000055 AssemblerPredicate<"FeatureExceptionHandling", "exception-handling">;
Heejin Ahn9386bde2018-02-24 00:40:50 +000056
57def NotHasExceptionHandling :
58 Predicate<"!Subtarget->hasExceptionHandling()">,
Thomas Lively88058d42019-01-31 21:02:19 +000059 AssemblerPredicate<"!FeatureExceptionHandling", "exception-handling">;
60
61def HasBulkMemory :
62 Predicate<"Subtarget->hasBulkMemory()">,
63 AssemblerPredicate<"FeatureBulkMemory", "bulk-memory">;
Heejin Ahn9386bde2018-02-24 00:40:50 +000064
Dan Gohman10e730a2015-06-29 23:51:55 +000065//===----------------------------------------------------------------------===//
66// WebAssembly-specific DAG Node Types.
67//===----------------------------------------------------------------------===//
68
Serge Pavlovd526b132017-05-09 13:35:13 +000069def SDT_WebAssemblyCallSeqStart : SDCallSeqStart<[SDTCisVT<0, iPTR>,
70 SDTCisVT<1, iPTR>]>;
JF Bastienaf111db2015-08-24 22:16:48 +000071def SDT_WebAssemblyCallSeqEnd :
72 SDCallSeqEnd<[SDTCisVT<0, iPTR>, SDTCisVT<1, iPTR>]>;
Sam Clegg492f7522019-03-26 19:46:15 +000073def SDT_WebAssemblyCall0 : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
74def SDT_WebAssemblyCall1 : SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>;
75def SDT_WebAssemblyBrTable : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
76def SDT_WebAssemblyArgument : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
77def SDT_WebAssemblyReturn : SDTypeProfile<0, -1, []>;
78def SDT_WebAssemblyWrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
79 SDTCisPtrTy<0>]>;
80def SDT_WebAssemblyWrapperPIC : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
81 SDTCisPtrTy<0>]>;
82def SDT_WebAssemblyThrow : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
JF Bastien600aee92015-07-31 17:53:38 +000083
Dan Gohman10e730a2015-06-29 23:51:55 +000084//===----------------------------------------------------------------------===//
85// WebAssembly-specific DAG Nodes.
86//===----------------------------------------------------------------------===//
87
JF Bastienaf111db2015-08-24 22:16:48 +000088def WebAssemblycallseq_start :
89 SDNode<"ISD::CALLSEQ_START", SDT_WebAssemblyCallSeqStart,
90 [SDNPHasChain, SDNPOutGlue]>;
91def WebAssemblycallseq_end :
92 SDNode<"ISD::CALLSEQ_END", SDT_WebAssemblyCallSeqEnd,
93 [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
Dan Gohmanf71abef2015-09-09 16:13:47 +000094def WebAssemblycall0 : SDNode<"WebAssemblyISD::CALL0",
95 SDT_WebAssemblyCall0,
96 [SDNPHasChain, SDNPVariadic]>;
97def WebAssemblycall1 : SDNode<"WebAssemblyISD::CALL1",
98 SDT_WebAssemblyCall1,
99 [SDNPHasChain, SDNPVariadic]>;
Dan Gohman14026062016-03-08 03:18:12 +0000100def WebAssemblybr_table : SDNode<"WebAssemblyISD::BR_TABLE",
101 SDT_WebAssemblyBrTable,
102 [SDNPHasChain, SDNPVariadic]>;
JF Bastien600aee92015-07-31 17:53:38 +0000103def WebAssemblyargument : SDNode<"WebAssemblyISD::ARGUMENT",
104 SDT_WebAssemblyArgument>;
105def WebAssemblyreturn : SDNode<"WebAssemblyISD::RETURN",
JF Bastienaf111db2015-08-24 22:16:48 +0000106 SDT_WebAssemblyReturn, [SDNPHasChain]>;
107def WebAssemblywrapper : SDNode<"WebAssemblyISD::Wrapper",
108 SDT_WebAssemblyWrapper>;
Sam Clegg492f7522019-03-26 19:46:15 +0000109def WebAssemblywrapperPIC : SDNode<"WebAssemblyISD::WrapperPIC",
110 SDT_WebAssemblyWrapperPIC>;
Heejin Ahnda419bd2018-11-14 02:46:21 +0000111def WebAssemblythrow : SDNode<"WebAssemblyISD::THROW", SDT_WebAssemblyThrow,
Heejin Ahnd6f48782019-01-30 03:21:57 +0000112 [SDNPHasChain, SDNPVariadic]>;
JF Bastien600aee92015-07-31 17:53:38 +0000113
Dan Gohman10e730a2015-06-29 23:51:55 +0000114//===----------------------------------------------------------------------===//
115// WebAssembly-specific Operands.
116//===----------------------------------------------------------------------===//
117
Dan Gohmana11fb232016-01-12 03:09:16 +0000118let OperandNamespace = "WebAssembly" in {
119
120let OperandType = "OPERAND_BASIC_BLOCK" in
Dan Gohman950a13c2015-09-16 16:51:30 +0000121def bb_op : Operand<OtherVT>;
JF Bastienaf111db2015-08-24 22:16:48 +0000122
Dan Gohman4fc4e422016-10-24 19:49:43 +0000123let OperandType = "OPERAND_LOCAL" in
124def local_op : Operand<i32>;
125
Dan Gohmanb89f2d32017-02-02 19:29:44 +0000126let OperandType = "OPERAND_GLOBAL" in
127def global_op : Operand<i32>;
128
Dan Gohman5a68ec72016-10-05 21:24:08 +0000129let OperandType = "OPERAND_I32IMM" in
130def i32imm_op : Operand<i32>;
131
132let OperandType = "OPERAND_I64IMM" in
133def i64imm_op : Operand<i64>;
134
Dan Gohman4b8e8be2016-10-03 21:31:31 +0000135let OperandType = "OPERAND_F32IMM" in
Dan Gohmana11fb232016-01-12 03:09:16 +0000136def f32imm_op : Operand<f32>;
Dan Gohmanaa742912016-02-16 15:14:23 +0000137
Dan Gohman4b8e8be2016-10-03 21:31:31 +0000138let OperandType = "OPERAND_F64IMM" in
Dan Gohmana11fb232016-01-12 03:09:16 +0000139def f64imm_op : Operand<f64>;
Dan Gohmana11fb232016-01-12 03:09:16 +0000140
Thomas Lively22442922018-08-21 21:03:18 +0000141let OperandType = "OPERAND_VEC_I8IMM" in
142def vec_i8imm_op : Operand<i32>;
143
144let OperandType = "OPERAND_VEC_I16IMM" in
145def vec_i16imm_op : Operand<i32>;
146
147let OperandType = "OPERAND_VEC_I32IMM" in
148def vec_i32imm_op : Operand<i32>;
149
150let OperandType = "OPERAND_VEC_I64IMM" in
151def vec_i64imm_op : Operand<i64>;
152
Dan Gohman00d734d2016-12-23 03:23:52 +0000153let OperandType = "OPERAND_FUNCTION32" in
154def function32_op : Operand<i32>;
155
156let OperandType = "OPERAND_OFFSET32" in
157def offset32_op : Operand<i32>;
158
Dan Gohmanbb372242016-01-26 03:39:31 +0000159let OperandType = "OPERAND_P2ALIGN" in {
160def P2Align : Operand<i32> {
161 let PrintMethod = "printWebAssemblyP2AlignOperand";
162}
Heejin Ahnda419bd2018-11-14 02:46:21 +0000163
164let OperandType = "OPERAND_EVENT" in
165def event_op : Operand<i32>;
166
Dan Gohmanbb372242016-01-26 03:39:31 +0000167} // OperandType = "OPERAND_P2ALIGN"
168
Heejin Ahn43675872019-02-06 00:17:03 +0000169let OperandType = "OPERAND_SIGNATURE" in
Dan Gohman2726b882016-10-06 22:29:32 +0000170def Signature : Operand<i32> {
171 let PrintMethod = "printWebAssemblySignatureOperand";
172}
Dan Gohman2726b882016-10-06 22:29:32 +0000173
Dan Gohmand934cb82017-02-24 23:18:00 +0000174let OperandType = "OPERAND_TYPEINDEX" in
175def TypeIndex : Operand<i32>;
176
Dan Gohmana11fb232016-01-12 03:09:16 +0000177} // OperandNamespace = "WebAssembly"
178
Dan Gohman10e730a2015-06-29 23:51:55 +0000179//===----------------------------------------------------------------------===//
Thomas Livelyc63b5fc2018-10-22 21:55:26 +0000180// WebAssembly Register to Stack instruction mapping
181//===----------------------------------------------------------------------===//
182
183class StackRel;
184def getStackOpcode : InstrMapping {
185 let FilterClass = "StackRel";
186 let RowFields = ["BaseName"];
187 let ColFields = ["StackBased"];
188 let KeyCol = ["false"];
189 let ValueCols = [["true"]];
190}
191
192//===----------------------------------------------------------------------===//
Dan Gohman10e730a2015-06-29 23:51:55 +0000193// WebAssembly Instruction Format Definitions.
194//===----------------------------------------------------------------------===//
195
196include "WebAssemblyInstrFormats.td"
197
Dan Gohman4ba48162015-11-18 16:12:01 +0000198//===----------------------------------------------------------------------===//
199// Additional instructions.
200//===----------------------------------------------------------------------===//
201
Thomas Lively0ff82ac2018-10-13 07:09:10 +0000202multiclass ARGUMENT<WebAssemblyRegClass reg, ValueType vt> {
Heejin Ahn43675872019-02-06 00:17:03 +0000203 let hasSideEffects = 1, isCodeGenOnly = 1, Defs = []<Register>,
204 Uses = [ARGUMENTS] in
Thomas Lively0ff82ac2018-10-13 07:09:10 +0000205 defm ARGUMENT_#vt :
206 I<(outs reg:$res), (ins i32imm:$argno), (outs), (ins i32imm:$argno),
207 [(set (vt reg:$res), (WebAssemblyargument timm:$argno))]>;
JF Bastien8f9aea02015-08-01 04:48:44 +0000208}
Thomas Lively0ff82ac2018-10-13 07:09:10 +0000209defm "": ARGUMENT<I32, i32>;
210defm "": ARGUMENT<I64, i64>;
211defm "": ARGUMENT<F32, f32>;
212defm "": ARGUMENT<F64, f64>;
213defm "": ARGUMENT<EXCEPT_REF, ExceptRef>;
JF Bastien600aee92015-07-31 17:53:38 +0000214
Thomas Lively6a87dda2019-01-08 06:25:55 +0000215// local.get and local.set are not generated by instruction selection; they
Dan Gohmanadf28172016-01-28 01:22:44 +0000216// are implied by virtual register uses and defs.
Dan Gohman4ba48162015-11-18 16:12:01 +0000217multiclass LOCAL<WebAssemblyRegClass vt> {
Heejin Ahn43675872019-02-06 00:17:03 +0000218 let hasSideEffects = 0 in {
Thomas Lively6a87dda2019-01-08 06:25:55 +0000219 // COPY is not an actual instruction in wasm, but since we allow local.get and
220 // local.set to be implicit during most of codegen, we can have a COPY which
221 // is actually a no-op because all the work is done in the implied local.get
222 // and local.set. COPYs are eliminated (and replaced with
223 // local.get/local.set) in the ExplicitLocals pass.
Dan Gohman4fc4e422016-10-24 19:49:43 +0000224 let isAsCheapAsAMove = 1, isCodeGenOnly = 1 in
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000225 defm COPY_#vt : I<(outs vt:$res), (ins vt:$src), (outs), (ins), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000226 "local.copy\t$res, $src", "local.copy">;
Dan Gohmanadf28172016-01-28 01:22:44 +0000227
Dan Gohman4fc4e422016-10-24 19:49:43 +0000228 // TEE is similar to COPY, but writes two copies of its result. Typically
229 // this would be used to stackify one result and write the other result to a
230 // local.
231 let isAsCheapAsAMove = 1, isCodeGenOnly = 1 in
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000232 defm TEE_#vt : I<(outs vt:$res, vt:$also), (ins vt:$src), (outs), (ins), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000233 "local.tee\t$res, $also, $src", "local.tee">;
Dan Gohman4fc4e422016-10-24 19:49:43 +0000234
Thomas Lively6a87dda2019-01-08 06:25:55 +0000235 // This is the actual local.get instruction in wasm. These are made explicit
Dan Gohman4fc4e422016-10-24 19:49:43 +0000236 // by the ExplicitLocals pass. It has mayLoad because it reads from a wasm
237 // local, which is a side effect not otherwise modeled in LLVM.
238 let mayLoad = 1, isAsCheapAsAMove = 1 in
Thomas Lively6a87dda2019-01-08 06:25:55 +0000239 defm LOCAL_GET_#vt : I<(outs vt:$res), (ins local_op:$local),
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000240 (outs), (ins local_op:$local), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000241 "local.get\t$res, $local", "local.get\t$local", 0x20>;
Dan Gohman4fc4e422016-10-24 19:49:43 +0000242
Thomas Lively6a87dda2019-01-08 06:25:55 +0000243 // This is the actual local.set instruction in wasm. These are made explicit
Dan Gohman4fc4e422016-10-24 19:49:43 +0000244 // by the ExplicitLocals pass. It has mayStore because it writes to a wasm
245 // local, which is a side effect not otherwise modeled in LLVM.
246 let mayStore = 1, isAsCheapAsAMove = 1 in
Thomas Lively6a87dda2019-01-08 06:25:55 +0000247 defm LOCAL_SET_#vt : I<(outs), (ins local_op:$local, vt:$src),
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000248 (outs), (ins local_op:$local), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000249 "local.set\t$local, $src", "local.set\t$local", 0x21>;
Dan Gohman4fc4e422016-10-24 19:49:43 +0000250
Thomas Lively6a87dda2019-01-08 06:25:55 +0000251 // This is the actual local.tee instruction in wasm. TEEs are turned into
252 // LOCAL_TEEs by the ExplicitLocals pass. It has mayStore for the same reason
253 // as LOCAL_SET.
Dan Gohman4fc4e422016-10-24 19:49:43 +0000254 let mayStore = 1, isAsCheapAsAMove = 1 in
Thomas Lively6a87dda2019-01-08 06:25:55 +0000255 defm LOCAL_TEE_#vt : I<(outs vt:$res), (ins local_op:$local, vt:$src),
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000256 (outs), (ins local_op:$local), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000257 "local.tee\t$res, $local, $src", "local.tee\t$local",
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000258 0x22>;
Dan Gohman4fc4e422016-10-24 19:49:43 +0000259
Dan Gohmanb89f2d32017-02-02 19:29:44 +0000260 // Unused values must be dropped in some contexts.
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000261 defm DROP_#vt : I<(outs), (ins vt:$src), (outs), (ins), [],
262 "drop\t$src", "drop", 0x1a>;
Dan Gohmanb89f2d32017-02-02 19:29:44 +0000263
264 let mayLoad = 1 in
Thomas Lively6a87dda2019-01-08 06:25:55 +0000265 defm GLOBAL_GET_#vt : I<(outs vt:$res), (ins global_op:$local),
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000266 (outs), (ins global_op:$local), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000267 "global.get\t$res, $local", "global.get\t$local",
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000268 0x23>;
Dan Gohmanb89f2d32017-02-02 19:29:44 +0000269
270 let mayStore = 1 in
Thomas Lively6a87dda2019-01-08 06:25:55 +0000271 defm GLOBAL_SET_#vt : I<(outs), (ins global_op:$local, vt:$src),
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000272 (outs), (ins global_op:$local), [],
Thomas Lively6a87dda2019-01-08 06:25:55 +0000273 "global.set\t$local, $src", "global.set\t$local",
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000274 0x24>;
Dan Gohmanb89f2d32017-02-02 19:29:44 +0000275
Dan Gohman4817a752016-05-16 19:16:32 +0000276} // hasSideEffects = 0
Dan Gohman4ba48162015-11-18 16:12:01 +0000277}
Sam Clegg537afe62018-06-04 16:59:26 +0000278defm "" : LOCAL<I32>;
279defm "" : LOCAL<I64>;
280defm "" : LOCAL<F32>;
281defm "" : LOCAL<F64>;
282defm "" : LOCAL<V128>, Requires<[HasSIMD128]>;
283defm "" : LOCAL<EXCEPT_REF>, Requires<[HasExceptionHandling]>;
JF Bastien4a642252015-08-10 22:36:48 +0000284
Dan Gohmanb6fd39a2016-01-19 16:59:23 +0000285let isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +0000286defm CONST_I32 : I<(outs I32:$res), (ins i32imm_op:$imm),
287 (outs), (ins i32imm_op:$imm),
288 [(set I32:$res, imm:$imm)],
289 "i32.const\t$res, $imm", "i32.const\t$imm", 0x41>;
290defm CONST_I64 : I<(outs I64:$res), (ins i64imm_op:$imm),
291 (outs), (ins i64imm_op:$imm),
292 [(set I64:$res, imm:$imm)],
293 "i64.const\t$res, $imm", "i64.const\t$imm", 0x42>;
294defm CONST_F32 : I<(outs F32:$res), (ins f32imm_op:$imm),
295 (outs), (ins f32imm_op:$imm),
296 [(set F32:$res, fpimm:$imm)],
297 "f32.const\t$res, $imm", "f32.const\t$imm", 0x43>;
298defm CONST_F64 : I<(outs F64:$res), (ins f64imm_op:$imm),
299 (outs), (ins f64imm_op:$imm),
300 [(set F64:$res, fpimm:$imm)],
301 "f64.const\t$res, $imm", "f64.const\t$imm", 0x44>;
Dan Gohmanb6fd39a2016-01-19 16:59:23 +0000302} // isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1
JF Bastien4a642252015-08-10 22:36:48 +0000303
Dan Gohman8633eed2016-01-08 00:50:33 +0000304def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$addr)),
Sam Clegg492f7522019-03-26 19:46:15 +0000305 (CONST_I32 tglobaladdr:$addr)>, Requires<[IsNotPIC]>;
306
307def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$addr)),
308 (GLOBAL_GET_I32 tglobaladdr:$addr)>, Requires<[IsPIC]>;
309
310def : Pat<(i32 (WebAssemblywrapperPIC tglobaladdr:$addr)),
311 (CONST_I32 tglobaladdr:$addr)>, Requires<[IsPIC]>;
312
Dan Gohman8633eed2016-01-08 00:50:33 +0000313def : Pat<(i32 (WebAssemblywrapper texternalsym:$addr)),
Sam Clegg492f7522019-03-26 19:46:15 +0000314 (GLOBAL_GET_I32 texternalsym:$addr)>, Requires<[IsPIC]>;
315
316def : Pat<(i32 (WebAssemblywrapper texternalsym:$addr)),
317 (CONST_I32 texternalsym:$addr)>, Requires<[IsNotPIC]>;
318
Heejin Ahn24faf852018-10-25 23:55:10 +0000319def : Pat<(i32 (WebAssemblywrapper mcsym:$sym)), (CONST_I32 mcsym:$sym)>;
320def : Pat<(i64 (WebAssemblywrapper mcsym:$sym)), (CONST_I64 mcsym:$sym)>;
Derek Schuff71e81692015-11-17 00:20:44 +0000321
Dan Gohman10e730a2015-06-29 23:51:55 +0000322//===----------------------------------------------------------------------===//
323// Additional sets of instructions.
324//===----------------------------------------------------------------------===//
325
JF Bastien5ca0bac2015-07-10 18:23:10 +0000326include "WebAssemblyInstrMemory.td"
327include "WebAssemblyInstrCall.td"
JF Bastien600aee92015-07-31 17:53:38 +0000328include "WebAssemblyInstrControl.td"
JF Bastien5ca0bac2015-07-10 18:23:10 +0000329include "WebAssemblyInstrInteger.td"
JF Bastien5ca0bac2015-07-10 18:23:10 +0000330include "WebAssemblyInstrConv.td"
Dan Gohmanf170ba02015-12-10 04:55:31 +0000331include "WebAssemblyInstrFloat.td"
Dan Gohman10e730a2015-06-29 23:51:55 +0000332include "WebAssemblyInstrAtomics.td"
333include "WebAssemblyInstrSIMD.td"
Heejin Ahn0de58722018-03-08 04:05:37 +0000334include "WebAssemblyInstrExceptRef.td"
Thomas Livelyd99af232019-02-05 00:49:55 +0000335include "WebAssemblyInstrBulkMemory.td"