blob: 620876e7cbbcc7896c9c3bd8ed6554fa6c219201 [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>
Ulrich Weigand5f613df2013-05-06 16:15:19 +000049 : ComplexPattern<vt, 1, "selectPCRelAddress", [z_pcrel_wrapper]>,
Richard Sandiford1fb58832013-05-14 09:47:26 +000050 PCRelOperand<vt, asmop> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +000051 let MIOperandInfo = (ops !cast<Operand>(self));
52}
53
54// Constructs an AsmOperandClass for addressing mode FORMAT, treating the
55// registers as having BITSIZE bits and displacements as having DISPSIZE bits.
Richard Sandiford1d959002013-07-02 14:56:45 +000056// LENGTH is "LenN" for addresses with an N-bit length field, otherwise it
57// is "".
58class AddressAsmOperand<string format, string bitsize, string dispsize,
59 string length = "">
Ulrich Weigand5f613df2013-05-06 16:15:19 +000060 : AsmOperandClass {
Richard Sandiford1d959002013-07-02 14:56:45 +000061 let Name = format##bitsize##"Disp"##dispsize##length;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000062 let ParserMethod = "parse"##format##bitsize;
63 let RenderMethod = "add"##format##"Operands";
64}
65
66// Constructs both a DAG pattern and instruction operand for an addressing mode.
Richard Sandiford1d959002013-07-02 14:56:45 +000067// FORMAT, BITSIZE, DISPSIZE and LENGTH are the parameters to an associated
68// AddressAsmOperand. OPERANDS is a list of NUMOPS individual operands
69// (base register, displacement, etc.). SELTYPE is the type of the memory
70// operand for selection purposes; sometimes we want different selection
71// choices for the same underlying addressing mode. SUFFIX is similarly
72// a suffix appended to the displacement for selection purposes;
73// e.g. we want to reject small 20-bit displacements if a 12-bit form
74// also exists, but we want to accept them otherwise.
75class AddressingMode<string seltype, string bitsize, string dispsize,
76 string suffix, string length, int numops, string format,
77 dag operands>
Ulrich Weigand5f613df2013-05-06 16:15:19 +000078 : ComplexPattern<!cast<ValueType>("i"##bitsize), numops,
Richard Sandiford1d959002013-07-02 14:56:45 +000079 "select"##seltype##dispsize##suffix##length,
Ulrich Weigand5f613df2013-05-06 16:15:19 +000080 [add, sub, or, frameindex, z_adjdynalloc]>,
81 Operand<!cast<ValueType>("i"##bitsize)> {
82 let PrintMethod = "print"##format##"Operand";
Richard Sandiford1d959002013-07-02 14:56:45 +000083 let EncoderMethod = "get"##format##dispsize##length##"Encoding";
84 let DecoderMethod =
85 "decode"##format##bitsize##"Disp"##dispsize##length##"Operand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +000086 let MIOperandInfo = operands;
87 let ParserMatchClass =
Richard Sandiford1d959002013-07-02 14:56:45 +000088 !cast<AddressAsmOperand>(format##bitsize##"Disp"##dispsize##length);
Ulrich Weigand5f613df2013-05-06 16:15:19 +000089}
90
91// An addressing mode with a base and displacement but no index.
92class BDMode<string type, string bitsize, string dispsize, string suffix>
Richard Sandiford1d959002013-07-02 14:56:45 +000093 : AddressingMode<type, bitsize, dispsize, suffix, "", 2, "BDAddr",
Ulrich Weigand5f613df2013-05-06 16:15:19 +000094 (ops !cast<RegisterOperand>("ADDR"##bitsize),
95 !cast<Immediate>("disp"##dispsize##"imm"##bitsize))>;
96
97// An addressing mode with a base, displacement and index.
98class BDXMode<string type, string bitsize, string dispsize, string suffix>
Richard Sandiford1d959002013-07-02 14:56:45 +000099 : AddressingMode<type, bitsize, dispsize, suffix, "", 3, "BDXAddr",
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000100 (ops !cast<RegisterOperand>("ADDR"##bitsize),
101 !cast<Immediate>("disp"##dispsize##"imm"##bitsize),
102 !cast<RegisterOperand>("ADDR"##bitsize))>;
103
Richard Sandiford1d959002013-07-02 14:56:45 +0000104// A BDMode paired with an immediate length operand of LENSIZE bits.
105class BDLMode<string type, string bitsize, string dispsize, string suffix,
106 string lensize>
107 : AddressingMode<type, bitsize, dispsize, suffix, "Len"##lensize, 3,
108 "BDLAddr",
109 (ops !cast<RegisterOperand>("ADDR"##bitsize),
110 !cast<Immediate>("disp"##dispsize##"imm"##bitsize),
111 !cast<Immediate>("imm"##bitsize))>;
112
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000113//===----------------------------------------------------------------------===//
114// Extracting immediate operands from nodes
115// These all create MVT::i64 nodes to ensure the value is not sign-extended
116// when converted from an SDNode to a MachineOperand later on.
117//===----------------------------------------------------------------------===//
118
119// Bits 0-15 (counting from the lsb).
120def LL16 : SDNodeXForm<imm, [{
121 uint64_t Value = N->getZExtValue() & 0x000000000000FFFFULL;
122 return CurDAG->getTargetConstant(Value, MVT::i64);
123}]>;
124
125// Bits 16-31 (counting from the lsb).
126def LH16 : SDNodeXForm<imm, [{
127 uint64_t Value = (N->getZExtValue() & 0x00000000FFFF0000ULL) >> 16;
128 return CurDAG->getTargetConstant(Value, MVT::i64);
129}]>;
130
131// Bits 32-47 (counting from the lsb).
132def HL16 : SDNodeXForm<imm, [{
133 uint64_t Value = (N->getZExtValue() & 0x0000FFFF00000000ULL) >> 32;
134 return CurDAG->getTargetConstant(Value, MVT::i64);
135}]>;
136
137// Bits 48-63 (counting from the lsb).
138def HH16 : SDNodeXForm<imm, [{
139 uint64_t Value = (N->getZExtValue() & 0xFFFF000000000000ULL) >> 48;
140 return CurDAG->getTargetConstant(Value, MVT::i64);
141}]>;
142
143// Low 32 bits.
144def LF32 : SDNodeXForm<imm, [{
145 uint64_t Value = N->getZExtValue() & 0x00000000FFFFFFFFULL;
146 return CurDAG->getTargetConstant(Value, MVT::i64);
147}]>;
148
149// High 32 bits.
150def HF32 : SDNodeXForm<imm, [{
151 uint64_t Value = N->getZExtValue() >> 32;
152 return CurDAG->getTargetConstant(Value, MVT::i64);
153}]>;
154
155// Truncate an immediate to a 8-bit signed quantity.
156def SIMM8 : SDNodeXForm<imm, [{
157 return CurDAG->getTargetConstant(int8_t(N->getZExtValue()), MVT::i64);
158}]>;
159
160// Truncate an immediate to a 8-bit unsigned quantity.
161def UIMM8 : SDNodeXForm<imm, [{
162 return CurDAG->getTargetConstant(uint8_t(N->getZExtValue()), MVT::i64);
163}]>;
164
165// Truncate an immediate to a 16-bit signed quantity.
166def SIMM16 : SDNodeXForm<imm, [{
167 return CurDAG->getTargetConstant(int16_t(N->getZExtValue()), MVT::i64);
168}]>;
169
170// Truncate an immediate to a 16-bit unsigned quantity.
171def UIMM16 : SDNodeXForm<imm, [{
172 return CurDAG->getTargetConstant(uint16_t(N->getZExtValue()), MVT::i64);
173}]>;
174
175// Truncate an immediate to a 32-bit signed quantity.
176def SIMM32 : SDNodeXForm<imm, [{
177 return CurDAG->getTargetConstant(int32_t(N->getZExtValue()), MVT::i64);
178}]>;
179
180// Truncate an immediate to a 32-bit unsigned quantity.
181def UIMM32 : SDNodeXForm<imm, [{
182 return CurDAG->getTargetConstant(uint32_t(N->getZExtValue()), MVT::i64);
183}]>;
184
185// Negate and then truncate an immediate to a 32-bit unsigned quantity.
186def NEGIMM32 : SDNodeXForm<imm, [{
187 return CurDAG->getTargetConstant(uint32_t(-N->getZExtValue()), MVT::i64);
188}]>;
189
190//===----------------------------------------------------------------------===//
191// Immediate asm operands.
192//===----------------------------------------------------------------------===//
193
194def U4Imm : ImmediateAsmOperand<"U4Imm">;
195def U6Imm : ImmediateAsmOperand<"U6Imm">;
196def S8Imm : ImmediateAsmOperand<"S8Imm">;
197def U8Imm : ImmediateAsmOperand<"U8Imm">;
198def S16Imm : ImmediateAsmOperand<"S16Imm">;
199def U16Imm : ImmediateAsmOperand<"U16Imm">;
200def S32Imm : ImmediateAsmOperand<"S32Imm">;
201def U32Imm : ImmediateAsmOperand<"U32Imm">;
202
203//===----------------------------------------------------------------------===//
204// 8-bit immediates
205//===----------------------------------------------------------------------===//
206
207def uimm8zx4 : Immediate<i8, [{
208 return isUInt<4>(N->getZExtValue());
209}], NOOP_SDNodeXForm, "U4Imm">;
210
211def uimm8zx6 : Immediate<i8, [{
212 return isUInt<6>(N->getZExtValue());
213}], NOOP_SDNodeXForm, "U6Imm">;
214
215def simm8 : Immediate<i8, [{}], SIMM8, "S8Imm">;
216def uimm8 : Immediate<i8, [{}], UIMM8, "U8Imm">;
217
218//===----------------------------------------------------------------------===//
219// i32 immediates
220//===----------------------------------------------------------------------===//
221
222// Immediates for the lower and upper 16 bits of an i32, with the other
223// bits of the i32 being zero.
224def imm32ll16 : Immediate<i32, [{
225 return SystemZ::isImmLL(N->getZExtValue());
226}], LL16, "U16Imm">;
227
228def imm32lh16 : Immediate<i32, [{
229 return SystemZ::isImmLH(N->getZExtValue());
230}], LH16, "U16Imm">;
231
232// Immediates for the lower and upper 16 bits of an i32, with the other
233// bits of the i32 being one.
234def imm32ll16c : Immediate<i32, [{
235 return SystemZ::isImmLL(uint32_t(~N->getZExtValue()));
236}], LL16, "U16Imm">;
237
238def imm32lh16c : Immediate<i32, [{
239 return SystemZ::isImmLH(uint32_t(~N->getZExtValue()));
240}], LH16, "U16Imm">;
241
242// Short immediates
243def imm32sx8 : Immediate<i32, [{
244 return isInt<8>(N->getSExtValue());
245}], SIMM8, "S8Imm">;
246
247def imm32zx8 : Immediate<i32, [{
248 return isUInt<8>(N->getZExtValue());
249}], UIMM8, "U8Imm">;
250
251def imm32zx8trunc : Immediate<i32, [{}], UIMM8, "U8Imm">;
252
253def imm32sx16 : Immediate<i32, [{
254 return isInt<16>(N->getSExtValue());
255}], SIMM16, "S16Imm">;
256
257def imm32zx16 : Immediate<i32, [{
258 return isUInt<16>(N->getZExtValue());
259}], UIMM16, "U16Imm">;
260
261def imm32sx16trunc : Immediate<i32, [{}], SIMM16, "S16Imm">;
262
263// Full 32-bit immediates. we need both signed and unsigned versions
264// because the assembler is picky. E.g. AFI requires signed operands
265// while NILF requires unsigned ones.
266def simm32 : Immediate<i32, [{}], SIMM32, "S32Imm">;
267def uimm32 : Immediate<i32, [{}], UIMM32, "U32Imm">;
268
269def imm32 : ImmLeaf<i32, [{}]>;
270
271//===----------------------------------------------------------------------===//
272// 64-bit immediates
273//===----------------------------------------------------------------------===//
274
275// Immediates for 16-bit chunks of an i64, with the other bits of the
276// i32 being zero.
277def imm64ll16 : Immediate<i64, [{
278 return SystemZ::isImmLL(N->getZExtValue());
279}], LL16, "U16Imm">;
280
281def imm64lh16 : Immediate<i64, [{
282 return SystemZ::isImmLH(N->getZExtValue());
283}], LH16, "U16Imm">;
284
285def imm64hl16 : Immediate<i64, [{
286 return SystemZ::isImmHL(N->getZExtValue());
287}], HL16, "U16Imm">;
288
289def imm64hh16 : Immediate<i64, [{
290 return SystemZ::isImmHH(N->getZExtValue());
291}], HH16, "U16Imm">;
292
293// Immediates for 16-bit chunks of an i64, with the other bits of the
294// i32 being one.
295def imm64ll16c : Immediate<i64, [{
296 return SystemZ::isImmLL(uint64_t(~N->getZExtValue()));
297}], LL16, "U16Imm">;
298
299def imm64lh16c : Immediate<i64, [{
300 return SystemZ::isImmLH(uint64_t(~N->getZExtValue()));
301}], LH16, "U16Imm">;
302
303def imm64hl16c : Immediate<i64, [{
304 return SystemZ::isImmHL(uint64_t(~N->getZExtValue()));
305}], HL16, "U16Imm">;
306
307def imm64hh16c : Immediate<i64, [{
308 return SystemZ::isImmHH(uint64_t(~N->getZExtValue()));
309}], HH16, "U16Imm">;
310
311// Immediates for the lower and upper 32 bits of an i64, with the other
312// bits of the i32 being zero.
313def imm64lf32 : Immediate<i64, [{
314 return SystemZ::isImmLF(N->getZExtValue());
315}], LF32, "U32Imm">;
316
317def imm64hf32 : Immediate<i64, [{
318 return SystemZ::isImmHF(N->getZExtValue());
319}], HF32, "U32Imm">;
320
321// Immediates for the lower and upper 32 bits of an i64, with the other
322// bits of the i32 being one.
323def imm64lf32c : Immediate<i64, [{
324 return SystemZ::isImmLF(uint64_t(~N->getZExtValue()));
325}], LF32, "U32Imm">;
326
327def imm64hf32c : Immediate<i64, [{
328 return SystemZ::isImmHF(uint64_t(~N->getZExtValue()));
329}], HF32, "U32Imm">;
330
331// Short immediates.
332def imm64sx8 : Immediate<i64, [{
333 return isInt<8>(N->getSExtValue());
334}], SIMM8, "S8Imm">;
335
336def imm64sx16 : Immediate<i64, [{
337 return isInt<16>(N->getSExtValue());
338}], SIMM16, "S16Imm">;
339
340def imm64zx16 : Immediate<i64, [{
341 return isUInt<16>(N->getZExtValue());
342}], UIMM16, "U16Imm">;
343
344def imm64sx32 : Immediate<i64, [{
345 return isInt<32>(N->getSExtValue());
346}], SIMM32, "S32Imm">;
347
348def imm64zx32 : Immediate<i64, [{
349 return isUInt<32>(N->getZExtValue());
350}], UIMM32, "U32Imm">;
351
352def imm64zx32n : Immediate<i64, [{
353 return isUInt<32>(-N->getSExtValue());
354}], NEGIMM32, "U32Imm">;
355
356def imm64 : ImmLeaf<i64, [{}]>;
357
358//===----------------------------------------------------------------------===//
359// Floating-point immediates
360//===----------------------------------------------------------------------===//
361
362// Floating-point zero.
363def fpimm0 : PatLeaf<(fpimm), [{ return N->isExactlyValue(+0.0); }]>;
364
365// Floating point negative zero.
366def fpimmneg0 : PatLeaf<(fpimm), [{ return N->isExactlyValue(-0.0); }]>;
367
368//===----------------------------------------------------------------------===//
369// Symbolic address operands
370//===----------------------------------------------------------------------===//
371
Richard Sandiford1fb58832013-05-14 09:47:26 +0000372// PC-relative asm operands.
373def PCRel16 : PCRelAsmOperand<"16">;
374def PCRel32 : PCRelAsmOperand<"32">;
375
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000376// PC-relative offsets of a basic block. The offset is sign-extended
377// and multiplied by 2.
Richard Sandiford1fb58832013-05-14 09:47:26 +0000378def brtarget16 : PCRelOperand<OtherVT, PCRel16> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000379 let EncoderMethod = "getPC16DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000380 let DecoderMethod = "decodePC16DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000381}
Richard Sandiford1fb58832013-05-14 09:47:26 +0000382def brtarget32 : PCRelOperand<OtherVT, PCRel32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000383 let EncoderMethod = "getPC32DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000384 let DecoderMethod = "decodePC32DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000385}
386
387// A PC-relative offset of a global value. The offset is sign-extended
388// and multiplied by 2.
Richard Sandiford1fb58832013-05-14 09:47:26 +0000389def pcrel32 : PCRelAddress<i64, "pcrel32", PCRel32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000390 let EncoderMethod = "getPC32DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000391 let DecoderMethod = "decodePC32DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000392}
393
394// A PC-relative offset of a global value when the value is used as a
395// call target. The offset is sign-extended and multiplied by 2.
Richard Sandiford1fb58832013-05-14 09:47:26 +0000396def pcrel16call : PCRelAddress<i64, "pcrel16call", PCRel16> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000397 let PrintMethod = "printCallOperand";
398 let EncoderMethod = "getPLT16DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000399 let DecoderMethod = "decodePC16DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000400}
Richard Sandiford1fb58832013-05-14 09:47:26 +0000401def pcrel32call : PCRelAddress<i64, "pcrel32call", PCRel32> {
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000402 let PrintMethod = "printCallOperand";
403 let EncoderMethod = "getPLT32DBLEncoding";
Richard Sandifordeb9af292013-05-14 10:17:52 +0000404 let DecoderMethod = "decodePC32DBLOperand";
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000405}
406
407//===----------------------------------------------------------------------===//
408// Addressing modes
409//===----------------------------------------------------------------------===//
410
411// 12-bit displacement operands.
412def disp12imm32 : Operand<i32>;
413def disp12imm64 : Operand<i64>;
414
415// 20-bit displacement operands.
416def disp20imm32 : Operand<i32>;
417def disp20imm64 : Operand<i64>;
418
Richard Sandiford1d959002013-07-02 14:56:45 +0000419def BDAddr32Disp12 : AddressAsmOperand<"BDAddr", "32", "12">;
420def BDAddr32Disp20 : AddressAsmOperand<"BDAddr", "32", "20">;
421def BDAddr64Disp12 : AddressAsmOperand<"BDAddr", "64", "12">;
422def BDAddr64Disp20 : AddressAsmOperand<"BDAddr", "64", "20">;
423def BDXAddr64Disp12 : AddressAsmOperand<"BDXAddr", "64", "12">;
424def BDXAddr64Disp20 : AddressAsmOperand<"BDXAddr", "64", "20">;
425def BDLAddr64Disp12Len8 : AddressAsmOperand<"BDLAddr", "64", "12", "Len8">;
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000426
427// DAG patterns and operands for addressing modes. Each mode has
Richard Sandiford1d959002013-07-02 14:56:45 +0000428// the form <type><range><group>[<len>] where:
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000429//
430// <type> is one of:
431// shift : base + displacement (32-bit)
432// bdaddr : base + displacement
433// bdxaddr : base + displacement + index
434// laaddr : like bdxaddr, but used for Load Address operations
435// dynalloc : base + displacement + index + ADJDYNALLOC
Richard Sandiford1d959002013-07-02 14:56:45 +0000436// bdladdr : base + displacement with a length field
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000437//
438// <range> is one of:
439// 12 : the displacement is an unsigned 12-bit value
440// 20 : the displacement is a signed 20-bit value
441//
442// <group> is one of:
443// pair : used when there is an equivalent instruction with the opposite
444// range value (12 or 20)
445// only : used when there is no equivalent instruction with the opposite
446// range value
Richard Sandiford1d959002013-07-02 14:56:45 +0000447//
448// <len> is one of:
449//
450// <empty> : there is no length field
451// len8 : the length field is 8 bits, with a range of [1, 0x100].
452def shift12only : BDMode <"BDAddr", "32", "12", "Only">;
453def shift20only : BDMode <"BDAddr", "32", "20", "Only">;
454def bdaddr12only : BDMode <"BDAddr", "64", "12", "Only">;
455def bdaddr12pair : BDMode <"BDAddr", "64", "12", "Pair">;
456def bdaddr20only : BDMode <"BDAddr", "64", "20", "Only">;
457def bdaddr20pair : BDMode <"BDAddr", "64", "20", "Pair">;
458def bdxaddr12only : BDXMode<"BDXAddr", "64", "12", "Only">;
459def bdxaddr12pair : BDXMode<"BDXAddr", "64", "12", "Pair">;
460def bdxaddr20only : BDXMode<"BDXAddr", "64", "20", "Only">;
461def bdxaddr20only128 : BDXMode<"BDXAddr", "64", "20", "Only128">;
462def bdxaddr20pair : BDXMode<"BDXAddr", "64", "20", "Pair">;
463def dynalloc12only : BDXMode<"DynAlloc", "64", "12", "Only">;
464def laaddr12pair : BDXMode<"LAAddr", "64", "12", "Pair">;
465def laaddr20pair : BDXMode<"LAAddr", "64", "20", "Pair">;
466def bdladdr12onlylen8 : BDLMode<"BDLAddr", "64", "12", "Only", "8">;
Ulrich Weigand5f613df2013-05-06 16:15:19 +0000467
468//===----------------------------------------------------------------------===//
469// Miscellaneous
470//===----------------------------------------------------------------------===//
471
472// Access registers. At present we just use them for accessing the thread
473// pointer, so we don't expose them as register to LLVM.
474def AccessReg : AsmOperandClass {
475 let Name = "AccessReg";
476 let ParserMethod = "parseAccessReg";
477}
478def access_reg : Immediate<i8, [{ return N->getZExtValue() < 16; }],
479 NOOP_SDNodeXForm, "AccessReg"> {
480 let ParserMatchClass = AccessReg;
481}
482
483// A 4-bit condition-code mask.
484def cond4 : PatLeaf<(i8 imm), [{ return (N->getZExtValue() < 16); }]>,
485 Operand<i8> {
486 let PrintMethod = "printCond4Operand";
487}