blob: 7be81dca727b19a3e620614b4494a066d62c49e6 [file] [log] [blame]
Ulrich Weigand5f613df2013-05-06 16:15:19 +00001//===-- SystemZOperands.td - SystemZ instruction operands ----*- tblgen-*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10//===----------------------------------------------------------------------===//
11// Class definitions
12//===----------------------------------------------------------------------===//
13
14class ImmediateAsmOperand<string name>
15 : AsmOperandClass {
16 let Name = name;
17 let RenderMethod = "addImmOperands";
18}
19
20// Constructs both a DAG pattern and instruction operand for an immediate
21// of type VT. PRED returns true if a node is acceptable and XFORM returns
22// the operand value associated with the node. ASMOP is the name of the
23// associated asm operand, and also forms the basis of the asm print method.
24class Immediate<ValueType vt, code pred, SDNodeXForm xform, string asmop>
25 : PatLeaf<(vt imm), pred, xform>, Operand<vt> {
26 let PrintMethod = "print"##asmop##"Operand";
Richard Sandifordeb9af292013-05-14 10:17:52 +000027 let DecoderMethod = "decode"##asmop##"Operand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +000028 let ParserMatchClass = !cast<AsmOperandClass>(asmop);
29}
30
Richard Sandiford1fb58832013-05-14 09:47:26 +000031// Constructs an asm operand for a PC-relative address. SIZE says how
32// many bits there are.
33class PCRelAsmOperand<string size> : ImmediateAsmOperand<"PCRel"##size> {
34 let PredicateMethod = "isImm";
35 let ParserMethod = "parsePCRel"##size;
36}
37
38// Constructs an operand for a PC-relative address with address type VT.
39// ASMOP is the associated asm operand.
40class PCRelOperand<ValueType vt, AsmOperandClass asmop> : Operand<vt> {
Richard Sandifordeb9af292013-05-14 10:17:52 +000041 let PrintMethod = "printPCRelOperand";
Richard Sandiford1fb58832013-05-14 09:47:26 +000042 let ParserMatchClass = asmop;
43}
44
Ulrich Weigand5f613df2013-05-06 16:15:19 +000045// Constructs both a DAG pattern and instruction operand for a PC-relative
Richard Sandiford1fb58832013-05-14 09:47:26 +000046// address with address size VT. SELF is the name of the operand and
47// ASMOP is the associated asm operand.
48class PCRelAddress<ValueType vt, string self, AsmOperandClass asmop>
Richard Sandiford54b36912013-09-27 15:14:04 +000049 : ComplexPattern<vt, 1, "selectPCRelAddress",
50 [z_pcrel_wrapper, z_pcrel_offset]>,
Richard Sandiford1fb58832013-05-14 09:47:26 +000051 PCRelOperand<vt, asmop> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +000052 let MIOperandInfo = (ops !cast<Operand>(self));
53}
54
55// Constructs an AsmOperandClass for addressing mode FORMAT, treating the
56// registers as having BITSIZE bits and displacements as having DISPSIZE bits.
Richard Sandiford1d959002013-07-02 14:56:45 +000057// LENGTH is "LenN" for addresses with an N-bit length field, otherwise it
58// is "".
59class AddressAsmOperand<string format, string bitsize, string dispsize,
60 string length = "">
Ulrich Weigand5f613df2013-05-06 16:15:19 +000061 : AsmOperandClass {
Richard Sandiford1d959002013-07-02 14:56:45 +000062 let Name = format##bitsize##"Disp"##dispsize##length;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000063 let ParserMethod = "parse"##format##bitsize;
64 let RenderMethod = "add"##format##"Operands";
65}
66
67// Constructs both a DAG pattern and instruction operand for an addressing mode.
Richard Sandiford1d959002013-07-02 14:56:45 +000068// FORMAT, BITSIZE, DISPSIZE and LENGTH are the parameters to an associated
69// AddressAsmOperand. OPERANDS is a list of NUMOPS individual operands
70// (base register, displacement, etc.). SELTYPE is the type of the memory
71// operand for selection purposes; sometimes we want different selection
72// choices for the same underlying addressing mode. SUFFIX is similarly
73// a suffix appended to the displacement for selection purposes;
74// e.g. we want to reject small 20-bit displacements if a 12-bit form
75// also exists, but we want to accept them otherwise.
76class AddressingMode<string seltype, string bitsize, string dispsize,
77 string suffix, string length, int numops, string format,
78 dag operands>
Ulrich Weigand5f613df2013-05-06 16:15:19 +000079 : ComplexPattern<!cast<ValueType>("i"##bitsize), numops,
Richard Sandiford1d959002013-07-02 14:56:45 +000080 "select"##seltype##dispsize##suffix##length,
Ulrich Weigand5f613df2013-05-06 16:15:19 +000081 [add, sub, or, frameindex, z_adjdynalloc]>,
82 Operand<!cast<ValueType>("i"##bitsize)> {
83 let PrintMethod = "print"##format##"Operand";
Richard Sandiford1d959002013-07-02 14:56:45 +000084 let EncoderMethod = "get"##format##dispsize##length##"Encoding";
85 let DecoderMethod =
86 "decode"##format##bitsize##"Disp"##dispsize##length##"Operand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +000087 let MIOperandInfo = operands;
88 let ParserMatchClass =
Richard Sandiford1d959002013-07-02 14:56:45 +000089 !cast<AddressAsmOperand>(format##bitsize##"Disp"##dispsize##length);
Ulrich Weigand5f613df2013-05-06 16:15:19 +000090}
91
92// An addressing mode with a base and displacement but no index.
93class BDMode<string type, string bitsize, string dispsize, string suffix>
Richard Sandiford1d959002013-07-02 14:56:45 +000094 : AddressingMode<type, bitsize, dispsize, suffix, "", 2, "BDAddr",
Ulrich Weigand5f613df2013-05-06 16:15:19 +000095 (ops !cast<RegisterOperand>("ADDR"##bitsize),
96 !cast<Immediate>("disp"##dispsize##"imm"##bitsize))>;
97
98// An addressing mode with a base, displacement and index.
99class BDXMode<string type, string bitsize, string dispsize, string suffix>
Richard Sandiford1d959002013-07-02 14:56:45 +0000100 : AddressingMode<type, bitsize, dispsize, suffix, "", 3, "BDXAddr",
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000101 (ops !cast<RegisterOperand>("ADDR"##bitsize),
102 !cast<Immediate>("disp"##dispsize##"imm"##bitsize),
103 !cast<RegisterOperand>("ADDR"##bitsize))>;
104
Richard Sandiford1d959002013-07-02 14:56:45 +0000105// A BDMode paired with an immediate length operand of LENSIZE bits.
106class BDLMode<string type, string bitsize, string dispsize, string suffix,
107 string lensize>
108 : AddressingMode<type, bitsize, dispsize, suffix, "Len"##lensize, 3,
109 "BDLAddr",
110 (ops !cast<RegisterOperand>("ADDR"##bitsize),
111 !cast<Immediate>("disp"##dispsize##"imm"##bitsize),
112 !cast<Immediate>("imm"##bitsize))>;
113
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000114//===----------------------------------------------------------------------===//
115// Extracting immediate operands from nodes
116// These all create MVT::i64 nodes to ensure the value is not sign-extended
117// when converted from an SDNode to a MachineOperand later on.
118//===----------------------------------------------------------------------===//
119
120// Bits 0-15 (counting from the lsb).
121def LL16 : SDNodeXForm<imm, [{
122 uint64_t Value = N->getZExtValue() & 0x000000000000FFFFULL;
123 return CurDAG->getTargetConstant(Value, MVT::i64);
124}]>;
125
126// Bits 16-31 (counting from the lsb).
127def LH16 : SDNodeXForm<imm, [{
128 uint64_t Value = (N->getZExtValue() & 0x00000000FFFF0000ULL) >> 16;
129 return CurDAG->getTargetConstant(Value, MVT::i64);
130}]>;
131
132// Bits 32-47 (counting from the lsb).
133def HL16 : SDNodeXForm<imm, [{
134 uint64_t Value = (N->getZExtValue() & 0x0000FFFF00000000ULL) >> 32;
135 return CurDAG->getTargetConstant(Value, MVT::i64);
136}]>;
137
138// Bits 48-63 (counting from the lsb).
139def HH16 : SDNodeXForm<imm, [{
140 uint64_t Value = (N->getZExtValue() & 0xFFFF000000000000ULL) >> 48;
141 return CurDAG->getTargetConstant(Value, MVT::i64);
142}]>;
143
144// Low 32 bits.
145def LF32 : SDNodeXForm<imm, [{
146 uint64_t Value = N->getZExtValue() & 0x00000000FFFFFFFFULL;
147 return CurDAG->getTargetConstant(Value, MVT::i64);
148}]>;
149
150// High 32 bits.
151def HF32 : SDNodeXForm<imm, [{
152 uint64_t Value = N->getZExtValue() >> 32;
153 return CurDAG->getTargetConstant(Value, MVT::i64);
154}]>;
155
156// Truncate an immediate to a 8-bit signed quantity.
157def SIMM8 : SDNodeXForm<imm, [{
158 return CurDAG->getTargetConstant(int8_t(N->getZExtValue()), MVT::i64);
159}]>;
160
161// Truncate an immediate to a 8-bit unsigned quantity.
162def UIMM8 : SDNodeXForm<imm, [{
163 return CurDAG->getTargetConstant(uint8_t(N->getZExtValue()), MVT::i64);
164}]>;
165
166// Truncate an immediate to a 16-bit signed quantity.
167def SIMM16 : SDNodeXForm<imm, [{
168 return CurDAG->getTargetConstant(int16_t(N->getZExtValue()), MVT::i64);
169}]>;
170
171// Truncate an immediate to a 16-bit unsigned quantity.
172def UIMM16 : SDNodeXForm<imm, [{
173 return CurDAG->getTargetConstant(uint16_t(N->getZExtValue()), MVT::i64);
174}]>;
175
176// Truncate an immediate to a 32-bit signed quantity.
177def SIMM32 : SDNodeXForm<imm, [{
178 return CurDAG->getTargetConstant(int32_t(N->getZExtValue()), MVT::i64);
179}]>;
180
181// Truncate an immediate to a 32-bit unsigned quantity.
182def UIMM32 : SDNodeXForm<imm, [{
183 return CurDAG->getTargetConstant(uint32_t(N->getZExtValue()), MVT::i64);
184}]>;
185
186// Negate and then truncate an immediate to a 32-bit unsigned quantity.
187def NEGIMM32 : SDNodeXForm<imm, [{
188 return CurDAG->getTargetConstant(uint32_t(-N->getZExtValue()), MVT::i64);
189}]>;
190
191//===----------------------------------------------------------------------===//
192// Immediate asm operands.
193//===----------------------------------------------------------------------===//
194
195def U4Imm : ImmediateAsmOperand<"U4Imm">;
196def U6Imm : ImmediateAsmOperand<"U6Imm">;
197def S8Imm : ImmediateAsmOperand<"S8Imm">;
198def U8Imm : ImmediateAsmOperand<"U8Imm">;
199def S16Imm : ImmediateAsmOperand<"S16Imm">;
200def U16Imm : ImmediateAsmOperand<"U16Imm">;
201def S32Imm : ImmediateAsmOperand<"S32Imm">;
202def U32Imm : ImmediateAsmOperand<"U32Imm">;
203
204//===----------------------------------------------------------------------===//
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000205// i32 immediates
206//===----------------------------------------------------------------------===//
207
208// Immediates for the lower and upper 16 bits of an i32, with the other
209// bits of the i32 being zero.
210def imm32ll16 : Immediate<i32, [{
211 return SystemZ::isImmLL(N->getZExtValue());
212}], LL16, "U16Imm">;
213
214def imm32lh16 : Immediate<i32, [{
215 return SystemZ::isImmLH(N->getZExtValue());
216}], LH16, "U16Imm">;
217
218// Immediates for the lower and upper 16 bits of an i32, with the other
219// bits of the i32 being one.
220def imm32ll16c : Immediate<i32, [{
221 return SystemZ::isImmLL(uint32_t(~N->getZExtValue()));
222}], LL16, "U16Imm">;
223
224def imm32lh16c : Immediate<i32, [{
225 return SystemZ::isImmLH(uint32_t(~N->getZExtValue()));
226}], LH16, "U16Imm">;
227
228// Short immediates
Richard Sandifordca446142014-07-10 10:52:51 +0000229def imm32zx4 : Immediate<i32, [{
230 return isUInt<4>(N->getZExtValue());
231}], NOOP_SDNodeXForm, "U4Imm">;
232
233def imm32zx6 : Immediate<i32, [{
234 return isUInt<6>(N->getZExtValue());
235}], NOOP_SDNodeXForm, "U6Imm">;
236
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000237def imm32sx8 : Immediate<i32, [{
238 return isInt<8>(N->getSExtValue());
239}], SIMM8, "S8Imm">;
240
241def imm32zx8 : Immediate<i32, [{
242 return isUInt<8>(N->getZExtValue());
243}], UIMM8, "U8Imm">;
244
245def imm32zx8trunc : Immediate<i32, [{}], UIMM8, "U8Imm">;
246
247def imm32sx16 : Immediate<i32, [{
248 return isInt<16>(N->getSExtValue());
249}], SIMM16, "S16Imm">;
250
251def imm32zx16 : Immediate<i32, [{
252 return isUInt<16>(N->getZExtValue());
253}], UIMM16, "U16Imm">;
254
255def imm32sx16trunc : Immediate<i32, [{}], SIMM16, "S16Imm">;
256
257// Full 32-bit immediates. we need both signed and unsigned versions
258// because the assembler is picky. E.g. AFI requires signed operands
259// while NILF requires unsigned ones.
260def simm32 : Immediate<i32, [{}], SIMM32, "S32Imm">;
261def uimm32 : Immediate<i32, [{}], UIMM32, "U32Imm">;
262
263def imm32 : ImmLeaf<i32, [{}]>;
264
265//===----------------------------------------------------------------------===//
266// 64-bit immediates
267//===----------------------------------------------------------------------===//
268
269// Immediates for 16-bit chunks of an i64, with the other bits of the
270// i32 being zero.
271def imm64ll16 : Immediate<i64, [{
272 return SystemZ::isImmLL(N->getZExtValue());
273}], LL16, "U16Imm">;
274
275def imm64lh16 : Immediate<i64, [{
276 return SystemZ::isImmLH(N->getZExtValue());
277}], LH16, "U16Imm">;
278
279def imm64hl16 : Immediate<i64, [{
280 return SystemZ::isImmHL(N->getZExtValue());
281}], HL16, "U16Imm">;
282
283def imm64hh16 : Immediate<i64, [{
284 return SystemZ::isImmHH(N->getZExtValue());
285}], HH16, "U16Imm">;
286
287// Immediates for 16-bit chunks of an i64, with the other bits of the
288// i32 being one.
289def imm64ll16c : Immediate<i64, [{
290 return SystemZ::isImmLL(uint64_t(~N->getZExtValue()));
291}], LL16, "U16Imm">;
292
293def imm64lh16c : Immediate<i64, [{
294 return SystemZ::isImmLH(uint64_t(~N->getZExtValue()));
295}], LH16, "U16Imm">;
296
297def imm64hl16c : Immediate<i64, [{
298 return SystemZ::isImmHL(uint64_t(~N->getZExtValue()));
299}], HL16, "U16Imm">;
300
301def imm64hh16c : Immediate<i64, [{
302 return SystemZ::isImmHH(uint64_t(~N->getZExtValue()));
303}], HH16, "U16Imm">;
304
305// Immediates for the lower and upper 32 bits of an i64, with the other
306// bits of the i32 being zero.
307def imm64lf32 : Immediate<i64, [{
308 return SystemZ::isImmLF(N->getZExtValue());
309}], LF32, "U32Imm">;
310
311def imm64hf32 : Immediate<i64, [{
312 return SystemZ::isImmHF(N->getZExtValue());
313}], HF32, "U32Imm">;
314
315// Immediates for the lower and upper 32 bits of an i64, with the other
316// bits of the i32 being one.
317def imm64lf32c : Immediate<i64, [{
318 return SystemZ::isImmLF(uint64_t(~N->getZExtValue()));
319}], LF32, "U32Imm">;
320
321def imm64hf32c : Immediate<i64, [{
322 return SystemZ::isImmHF(uint64_t(~N->getZExtValue()));
323}], HF32, "U32Imm">;
324
325// Short immediates.
326def imm64sx8 : Immediate<i64, [{
327 return isInt<8>(N->getSExtValue());
328}], SIMM8, "S8Imm">;
329
Richard Sandiford93183ee2013-09-18 09:56:40 +0000330def imm64zx8 : Immediate<i64, [{
331 return isUInt<8>(N->getSExtValue());
332}], UIMM8, "U8Imm">;
333
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000334def imm64sx16 : Immediate<i64, [{
335 return isInt<16>(N->getSExtValue());
336}], SIMM16, "S16Imm">;
337
338def imm64zx16 : Immediate<i64, [{
339 return isUInt<16>(N->getZExtValue());
340}], UIMM16, "U16Imm">;
341
342def imm64sx32 : Immediate<i64, [{
343 return isInt<32>(N->getSExtValue());
344}], SIMM32, "S32Imm">;
345
346def imm64zx32 : Immediate<i64, [{
347 return isUInt<32>(N->getZExtValue());
348}], UIMM32, "U32Imm">;
349
350def imm64zx32n : Immediate<i64, [{
351 return isUInt<32>(-N->getSExtValue());
352}], NEGIMM32, "U32Imm">;
353
Richard Sandiford5e318f02013-08-27 09:54:29 +0000354def imm64 : ImmLeaf<i64, [{}]>, Operand<i64>;
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000355
356//===----------------------------------------------------------------------===//
357// Floating-point immediates
358//===----------------------------------------------------------------------===//
359
360// Floating-point zero.
361def fpimm0 : PatLeaf<(fpimm), [{ return N->isExactlyValue(+0.0); }]>;
362
363// Floating point negative zero.
364def fpimmneg0 : PatLeaf<(fpimm), [{ return N->isExactlyValue(-0.0); }]>;
365
366//===----------------------------------------------------------------------===//
367// Symbolic address operands
368//===----------------------------------------------------------------------===//
369
Richard Sandiford1fb58832013-05-14 09:47:26 +0000370// PC-relative asm operands.
371def PCRel16 : PCRelAsmOperand<"16">;
372def PCRel32 : PCRelAsmOperand<"32">;
373
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000374// PC-relative offsets of a basic block. The offset is sign-extended
375// and multiplied by 2.
Richard Sandiford1fb58832013-05-14 09:47:26 +0000376def brtarget16 : PCRelOperand<OtherVT, PCRel16> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000377 let EncoderMethod = "getPC16DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000378 let DecoderMethod = "decodePC16DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000379}
Richard Sandiford1fb58832013-05-14 09:47:26 +0000380def brtarget32 : PCRelOperand<OtherVT, PCRel32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000381 let EncoderMethod = "getPC32DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000382 let DecoderMethod = "decodePC32DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000383}
384
385// A PC-relative offset of a global value. The offset is sign-extended
386// and multiplied by 2.
Richard Sandiford1fb58832013-05-14 09:47:26 +0000387def pcrel32 : PCRelAddress<i64, "pcrel32", PCRel32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000388 let EncoderMethod = "getPC32DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000389 let DecoderMethod = "decodePC32DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000390}
391
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000392//===----------------------------------------------------------------------===//
393// Addressing modes
394//===----------------------------------------------------------------------===//
395
396// 12-bit displacement operands.
397def disp12imm32 : Operand<i32>;
398def disp12imm64 : Operand<i64>;
399
400// 20-bit displacement operands.
401def disp20imm32 : Operand<i32>;
402def disp20imm64 : Operand<i64>;
403
Richard Sandiford1d959002013-07-02 14:56:45 +0000404def BDAddr32Disp12 : AddressAsmOperand<"BDAddr", "32", "12">;
405def BDAddr32Disp20 : AddressAsmOperand<"BDAddr", "32", "20">;
406def BDAddr64Disp12 : AddressAsmOperand<"BDAddr", "64", "12">;
407def BDAddr64Disp20 : AddressAsmOperand<"BDAddr", "64", "20">;
408def BDXAddr64Disp12 : AddressAsmOperand<"BDXAddr", "64", "12">;
409def BDXAddr64Disp20 : AddressAsmOperand<"BDXAddr", "64", "20">;
410def BDLAddr64Disp12Len8 : AddressAsmOperand<"BDLAddr", "64", "12", "Len8">;
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000411
412// DAG patterns and operands for addressing modes. Each mode has
Richard Sandiford1d959002013-07-02 14:56:45 +0000413// the form <type><range><group>[<len>] where:
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000414//
415// <type> is one of:
416// shift : base + displacement (32-bit)
417// bdaddr : base + displacement
Richard Sandiforda481f582013-08-23 11:18:53 +0000418// mviaddr : like bdaddr, but reject cases with a natural index
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000419// bdxaddr : base + displacement + index
420// laaddr : like bdxaddr, but used for Load Address operations
421// dynalloc : base + displacement + index + ADJDYNALLOC
Richard Sandiford1d959002013-07-02 14:56:45 +0000422// bdladdr : base + displacement with a length field
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000423//
424// <range> is one of:
425// 12 : the displacement is an unsigned 12-bit value
426// 20 : the displacement is a signed 20-bit value
427//
428// <group> is one of:
429// pair : used when there is an equivalent instruction with the opposite
430// range value (12 or 20)
431// only : used when there is no equivalent instruction with the opposite
432// range value
Richard Sandiford1d959002013-07-02 14:56:45 +0000433//
434// <len> is one of:
435//
436// <empty> : there is no length field
437// len8 : the length field is 8 bits, with a range of [1, 0x100].
438def shift12only : BDMode <"BDAddr", "32", "12", "Only">;
439def shift20only : BDMode <"BDAddr", "32", "20", "Only">;
440def bdaddr12only : BDMode <"BDAddr", "64", "12", "Only">;
441def bdaddr12pair : BDMode <"BDAddr", "64", "12", "Pair">;
442def bdaddr20only : BDMode <"BDAddr", "64", "20", "Only">;
443def bdaddr20pair : BDMode <"BDAddr", "64", "20", "Pair">;
Richard Sandiforda481f582013-08-23 11:18:53 +0000444def mviaddr12pair : BDMode <"MVIAddr", "64", "12", "Pair">;
445def mviaddr20pair : BDMode <"MVIAddr", "64", "20", "Pair">;
Richard Sandiford1d959002013-07-02 14:56:45 +0000446def bdxaddr12only : BDXMode<"BDXAddr", "64", "12", "Only">;
447def bdxaddr12pair : BDXMode<"BDXAddr", "64", "12", "Pair">;
448def bdxaddr20only : BDXMode<"BDXAddr", "64", "20", "Only">;
449def bdxaddr20only128 : BDXMode<"BDXAddr", "64", "20", "Only128">;
450def bdxaddr20pair : BDXMode<"BDXAddr", "64", "20", "Pair">;
451def dynalloc12only : BDXMode<"DynAlloc", "64", "12", "Only">;
452def laaddr12pair : BDXMode<"LAAddr", "64", "12", "Pair">;
453def laaddr20pair : BDXMode<"LAAddr", "64", "20", "Pair">;
454def bdladdr12onlylen8 : BDLMode<"BDLAddr", "64", "12", "Only", "8">;
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000455
456//===----------------------------------------------------------------------===//
457// Miscellaneous
458//===----------------------------------------------------------------------===//
459
460// Access registers. At present we just use them for accessing the thread
461// pointer, so we don't expose them as register to LLVM.
462def AccessReg : AsmOperandClass {
463 let Name = "AccessReg";
464 let ParserMethod = "parseAccessReg";
465}
Richard Sandifordca446142014-07-10 10:52:51 +0000466def access_reg : Immediate<i32, [{ return N->getZExtValue() < 16; }],
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000467 NOOP_SDNodeXForm, "AccessReg"> {
468 let ParserMatchClass = AccessReg;
469}
470
471// A 4-bit condition-code mask.
Richard Sandifordca446142014-07-10 10:52:51 +0000472def cond4 : PatLeaf<(i32 imm), [{ return (N->getZExtValue() < 16); }]>,
473 Operand<i32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000474 let PrintMethod = "printCond4Operand";
475}