1 //===- SPUOperands.td - Cell SPU Instruction Operands ------*- 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 //===----------------------------------------------------------------------===//
9 // Cell SPU Instruction Operands:
10 //===----------------------------------------------------------------------===//
12 def LO16 : SDNodeXForm<imm, [{
13 unsigned val = N->getZExtValue();
14 // Transformation function: get the low 16 bits.
15 return getI32Imm(val & 0xffff);
18 def LO16_vec : SDNodeXForm<scalar_to_vector, [{
21 // Transformation function: get the low 16 bit immediate from a build_vector
23 assert(N->getOpcode() == ISD::BUILD_VECTOR
24 && "LO16_vec got something other than a BUILD_VECTOR");
26 // Get first constant operand...
27 for (unsigned i = 0, e = N->getNumOperands();
28 OpVal.getNode() == 0 && i != e; ++i) {
29 if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
30 if (OpVal.getNode() == 0)
31 OpVal = N->getOperand(i);
34 assert(OpVal.getNode() != 0 && "LO16_vec did not locate a <defined> node");
35 ConstantSDNode *CN = cast<ConstantSDNode>(OpVal);
36 return getI32Imm((unsigned)CN->getZExtValue() & 0xffff);
39 // Transform an immediate, returning the high 16 bits shifted down:
40 def HI16 : SDNodeXForm<imm, [{
41 return getI32Imm((unsigned)N->getZExtValue() >> 16);
44 // Transformation function: shift the high 16 bit immediate from a build_vector
45 // node into the low 16 bits, and return a 16-bit constant.
46 def HI16_vec : SDNodeXForm<scalar_to_vector, [{
49 assert(N->getOpcode() == ISD::BUILD_VECTOR
50 && "HI16_vec got something other than a BUILD_VECTOR");
52 // Get first constant operand...
53 for (unsigned i = 0, e = N->getNumOperands();
54 OpVal.getNode() == 0 && i != e; ++i) {
55 if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue;
56 if (OpVal.getNode() == 0)
57 OpVal = N->getOperand(i);
60 assert(OpVal.getNode() != 0 && "HI16_vec did not locate a <defined> node");
61 ConstantSDNode *CN = cast<ConstantSDNode>(OpVal);
62 return getI32Imm((unsigned)CN->getZExtValue() >> 16);
65 // simm7 predicate - True if the immediate fits in an 7-bit signed
67 def simm7: PatLeaf<(imm), [{
68 int sextVal = int(N->getSExtValue());
69 return (sextVal >= -64 && sextVal <= 63);
72 // uimm7 predicate - True if the immediate fits in an 7-bit unsigned
74 def uimm7: PatLeaf<(imm), [{
75 return (N->getZExtValue() <= 0x7f);
78 // immSExt8 predicate - True if the immediate fits in an 8-bit sign extended
80 def immSExt8 : PatLeaf<(imm), [{
81 int Value = int(N->getSExtValue());
82 return (Value >= -(1 << 8) && Value <= (1 << 8) - 1);
85 // immU8: immediate, unsigned 8-bit quantity
86 def immU8 : PatLeaf<(imm), [{
87 return (N->getZExtValue() <= 0xff);
90 // i64ImmSExt10 predicate - True if the i64 immediate fits in a 10-bit sign
91 // extended field. Used by RI10Form instructions like 'ldq'.
92 def i64ImmSExt10 : PatLeaf<(imm), [{
93 return isI64IntS10Immediate(N);
96 // i32ImmSExt10 predicate - True if the i32 immediate fits in a 10-bit sign
97 // extended field. Used by RI10Form instructions like 'ldq'.
98 def i32ImmSExt10 : PatLeaf<(imm), [{
99 return isI32IntS10Immediate(N);
102 // i32ImmUns10 predicate - True if the i32 immediate fits in a 10-bit unsigned
103 // field. Used by RI10Form instructions like 'ldq'.
104 def i32ImmUns10 : PatLeaf<(imm), [{
105 return isI32IntU10Immediate(N);
108 // i16ImmSExt10 predicate - True if the i16 immediate fits in a 10-bit sign
109 // extended field. Used by RI10Form instructions like 'ldq'.
110 def i16ImmSExt10 : PatLeaf<(imm), [{
111 return isI16IntS10Immediate(N);
114 // i16ImmUns10 predicate - True if the i16 immediate fits into a 10-bit unsigned
115 // value. Used by RI10Form instructions.
116 def i16ImmUns10 : PatLeaf<(imm), [{
117 return isI16IntU10Immediate(N);
120 def immSExt16 : PatLeaf<(imm), [{
121 // immSExt16 predicate - True if the immediate fits in a 16-bit sign extended
124 return isIntS16Immediate(N, Ignored);
127 def immZExt16 : PatLeaf<(imm), [{
128 // immZExt16 predicate - True if the immediate fits in a 16-bit zero extended
130 return (uint64_t)N->getZExtValue() == (unsigned short)N->getZExtValue();
133 def immU16 : PatLeaf<(imm), [{
134 // immU16 predicate- True if the immediate fits into a 16-bit unsigned field.
135 return (uint64_t)N->getZExtValue() == (N->getZExtValue() & 0xffff);
138 def imm18 : PatLeaf<(imm), [{
139 // imm18 predicate: True if the immediate fits into an 18-bit unsigned field.
140 int Value = (int) N->getZExtValue();
141 return ((Value & ((1 << 19) - 1)) == Value);
144 def lo16 : PatLeaf<(imm), [{
145 // lo16 predicate - returns true if the immediate has all zeros in the
146 // low order bits and is a 32-bit constant:
147 if (N->getValueType(0) == MVT::i32) {
148 uint32_t val = N->getZExtValue();
149 return ((val & 0x0000ffff) == val);
155 def hi16 : PatLeaf<(imm), [{
156 // hi16 predicate - returns true if the immediate has all zeros in the
157 // low order bits and is a 32-bit constant:
158 if (N->getValueType(0) == MVT::i32) {
159 uint32_t val = uint32_t(N->getZExtValue());
160 return ((val & 0xffff0000) == val);
161 } else if (N->getValueType(0) == MVT::i64) {
162 uint64_t val = N->getZExtValue();
163 return ((val & 0xffff0000ULL) == val);
169 def bitshift : PatLeaf<(imm), [{
170 // bitshift predicate - returns true if 0 < imm <= 7 for SHLQBII
171 // (shift left quadword by bits immediate)
172 int64_t Val = N->getZExtValue();
173 return (Val > 0 && Val <= 7);
176 //===----------------------------------------------------------------------===//
177 // Floating point operands:
178 //===----------------------------------------------------------------------===//
180 // Transform a float, returning the high 16 bits shifted down, as if
181 // the float was really an unsigned integer:
182 def HI16_f32 : SDNodeXForm<fpimm, [{
183 float fval = N->getValueAPF().convertToFloat();
184 return getI32Imm(FloatToBits(fval) >> 16);
187 // Transformation function on floats: get the low 16 bits as if the float was
188 // an unsigned integer.
189 def LO16_f32 : SDNodeXForm<fpimm, [{
190 float fval = N->getValueAPF().convertToFloat();
191 return getI32Imm(FloatToBits(fval) & 0xffff);
194 def FPimm_sext16 : SDNodeXForm<fpimm, [{
195 float fval = N->getValueAPF().convertToFloat();
196 return getI32Imm((int) ((FloatToBits(fval) << 16) >> 16));
199 def FPimm_u18 : SDNodeXForm<fpimm, [{
200 float fval = N->getValueAPF().convertToFloat();
201 return getI32Imm(FloatToBits(fval) & ((1 << 19) - 1));
204 def fpimmSExt16 : PatLeaf<(fpimm), [{
206 return isFPS16Immediate(N, Ignored);
209 // Does the SFP constant only have upp 16 bits set?
210 def hi16_f32 : PatLeaf<(fpimm), [{
211 if (N->getValueType(0) == MVT::f32) {
212 uint32_t val = FloatToBits(N->getValueAPF().convertToFloat());
213 return ((val & 0xffff0000) == val);
219 // Does the SFP constant fit into 18 bits?
220 def fpimm18 : PatLeaf<(fpimm), [{
221 if (N->getValueType(0) == MVT::f32) {
222 uint32_t Value = FloatToBits(N->getValueAPF().convertToFloat());
223 return ((Value & ((1 << 19) - 1)) == Value);
229 //===----------------------------------------------------------------------===//
230 // 64-bit operands (TODO):
231 //===----------------------------------------------------------------------===//
233 //===----------------------------------------------------------------------===//
234 // build_vector operands:
235 //===----------------------------------------------------------------------===//
237 // v16i8SExt8Imm_xform function: convert build_vector to 8-bit sign extended
238 // immediate constant load for v16i8 vectors. N.B.: The incoming constant has
239 // to be a 16-bit quantity with the upper and lower bytes equal (e.g., 0x2a2a).
240 def v16i8SExt8Imm_xform: SDNodeXForm<build_vector, [{
241 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8);
244 // v16i8SExt8Imm: Predicate test for 8-bit sign extended immediate constant
245 // load, works in conjunction with its transform function. N.B.: This relies the
246 // incoming constant being a 16-bit quantity, where the upper and lower bytes
247 // are EXACTLY the same (e.g., 0x2a2a)
248 def v16i8SExt8Imm: PatLeaf<(build_vector), [{
249 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8).getNode() != 0;
250 }], v16i8SExt8Imm_xform>;
252 // v16i8U8Imm_xform function: convert build_vector to unsigned 8-bit
253 // immediate constant load for v16i8 vectors. N.B.: The incoming constant has
254 // to be a 16-bit quantity with the upper and lower bytes equal (e.g., 0x2a2a).
255 def v16i8U8Imm_xform: SDNodeXForm<build_vector, [{
256 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8);
259 // v16i8U8Imm: Predicate test for unsigned 8-bit immediate constant
260 // load, works in conjunction with its transform function. N.B.: This relies the
261 // incoming constant being a 16-bit quantity, where the upper and lower bytes
262 // are EXACTLY the same (e.g., 0x2a2a)
263 def v16i8U8Imm: PatLeaf<(build_vector), [{
264 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i8).getNode() != 0;
265 }], v16i8U8Imm_xform>;
267 // v8i16SExt8Imm_xform function: convert build_vector to 8-bit sign extended
268 // immediate constant load for v8i16 vectors.
269 def v8i16SExt8Imm_xform: SDNodeXForm<build_vector, [{
270 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i16);
273 // v8i16SExt8Imm: Predicate test for 8-bit sign extended immediate constant
274 // load, works in conjunction with its transform function.
275 def v8i16SExt8Imm: PatLeaf<(build_vector), [{
276 return SPU::get_vec_i8imm(N, *CurDAG, MVT::i16).getNode() != 0;
277 }], v8i16SExt8Imm_xform>;
279 // v8i16SExt10Imm_xform function: convert build_vector to 16-bit sign extended
280 // immediate constant load for v8i16 vectors.
281 def v8i16SExt10Imm_xform: SDNodeXForm<build_vector, [{
282 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16);
285 // v8i16SExt10Imm: Predicate test for 16-bit sign extended immediate constant
286 // load, works in conjunction with its transform function.
287 def v8i16SExt10Imm: PatLeaf<(build_vector), [{
288 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16).getNode() != 0;
289 }], v8i16SExt10Imm_xform>;
291 // v8i16Uns10Imm_xform function: convert build_vector to 16-bit unsigned
292 // immediate constant load for v8i16 vectors.
293 def v8i16Uns10Imm_xform: SDNodeXForm<build_vector, [{
294 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16);
297 // v8i16Uns10Imm: Predicate test for 16-bit unsigned immediate constant
298 // load, works in conjunction with its transform function.
299 def v8i16Uns10Imm: PatLeaf<(build_vector), [{
300 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i16).getNode() != 0;
301 }], v8i16Uns10Imm_xform>;
303 // v8i16SExt16Imm_xform function: convert build_vector to 16-bit sign extended
304 // immediate constant load for v8i16 vectors.
305 def v8i16Uns16Imm_xform: SDNodeXForm<build_vector, [{
306 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i16);
309 // v8i16SExt16Imm: Predicate test for 16-bit sign extended immediate constant
310 // load, works in conjunction with its transform function.
311 def v8i16SExt16Imm: PatLeaf<(build_vector), [{
312 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i16).getNode() != 0;
313 }], v8i16Uns16Imm_xform>;
315 // v4i32SExt10Imm_xform function: convert build_vector to 10-bit sign extended
316 // immediate constant load for v4i32 vectors.
317 def v4i32SExt10Imm_xform: SDNodeXForm<build_vector, [{
318 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32);
321 // v4i32SExt10Imm: Predicate test for 10-bit sign extended immediate constant
322 // load, works in conjunction with its transform function.
323 def v4i32SExt10Imm: PatLeaf<(build_vector), [{
324 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32).getNode() != 0;
325 }], v4i32SExt10Imm_xform>;
327 // v4i32Uns10Imm_xform function: convert build_vector to 10-bit unsigned
328 // immediate constant load for v4i32 vectors.
329 def v4i32Uns10Imm_xform: SDNodeXForm<build_vector, [{
330 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32);
333 // v4i32Uns10Imm: Predicate test for 10-bit unsigned immediate constant
334 // load, works in conjunction with its transform function.
335 def v4i32Uns10Imm: PatLeaf<(build_vector), [{
336 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i32).getNode() != 0;
337 }], v4i32Uns10Imm_xform>;
339 // v4i32SExt16Imm_xform function: convert build_vector to 16-bit sign extended
340 // immediate constant load for v4i32 vectors.
341 def v4i32SExt16Imm_xform: SDNodeXForm<build_vector, [{
342 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i32);
345 // v4i32SExt16Imm: Predicate test for 16-bit sign extended immediate constant
346 // load, works in conjunction with its transform function.
347 def v4i32SExt16Imm: PatLeaf<(build_vector), [{
348 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i32).getNode() != 0;
349 }], v4i32SExt16Imm_xform>;
351 // v4i32Uns18Imm_xform function: convert build_vector to 18-bit unsigned
352 // immediate constant load for v4i32 vectors.
353 def v4i32Uns18Imm_xform: SDNodeXForm<build_vector, [{
354 return SPU::get_vec_u18imm(N, *CurDAG, MVT::i32);
357 // v4i32Uns18Imm: Predicate test for 18-bit unsigned immediate constant load,
358 // works in conjunction with its transform function.
359 def v4i32Uns18Imm: PatLeaf<(build_vector), [{
360 return SPU::get_vec_u18imm(N, *CurDAG, MVT::i32).getNode() != 0;
361 }], v4i32Uns18Imm_xform>;
363 // ILHUvec_get_imm xform function: convert build_vector to ILHUvec imm constant
365 def ILHUvec_get_imm: SDNodeXForm<build_vector, [{
366 return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i32);
369 /// immILHUvec: Predicate test for a ILHU constant vector.
370 def immILHUvec: PatLeaf<(build_vector), [{
371 return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i32).getNode() != 0;
372 }], ILHUvec_get_imm>;
374 // Catch-all for any other i32 vector constants
375 def v4i32_get_imm: SDNodeXForm<build_vector, [{
376 return SPU::get_v4i32_imm(N, *CurDAG);
379 def v4i32Imm: PatLeaf<(build_vector), [{
380 return SPU::get_v4i32_imm(N, *CurDAG).getNode() != 0;
383 // v2i64SExt10Imm_xform function: convert build_vector to 10-bit sign extended
384 // immediate constant load for v2i64 vectors.
385 def v2i64SExt10Imm_xform: SDNodeXForm<build_vector, [{
386 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i64);
389 // v2i64SExt10Imm: Predicate test for 10-bit sign extended immediate constant
390 // load, works in conjunction with its transform function.
391 def v2i64SExt10Imm: PatLeaf<(build_vector), [{
392 return SPU::get_vec_i10imm(N, *CurDAG, MVT::i64).getNode() != 0;
393 }], v2i64SExt10Imm_xform>;
395 // v2i64SExt16Imm_xform function: convert build_vector to 16-bit sign extended
396 // immediate constant load for v2i64 vectors.
397 def v2i64SExt16Imm_xform: SDNodeXForm<build_vector, [{
398 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i64);
401 // v2i64SExt16Imm: Predicate test for 16-bit sign extended immediate constant
402 // load, works in conjunction with its transform function.
403 def v2i64SExt16Imm: PatLeaf<(build_vector), [{
404 return SPU::get_vec_i16imm(N, *CurDAG, MVT::i64).getNode() != 0;
405 }], v2i64SExt16Imm_xform>;
407 // v2i64Uns18Imm_xform function: convert build_vector to 18-bit unsigned
408 // immediate constant load for v2i64 vectors.
409 def v2i64Uns18Imm_xform: SDNodeXForm<build_vector, [{
410 return SPU::get_vec_u18imm(N, *CurDAG, MVT::i64);
413 // v2i64Uns18Imm: Predicate test for 18-bit unsigned immediate constant load,
414 // works in conjunction with its transform function.
415 def v2i64Uns18Imm: PatLeaf<(build_vector), [{
416 return SPU::get_vec_u18imm(N, *CurDAG, MVT::i64).getNode() != 0;
417 }], v2i64Uns18Imm_xform>;
419 /// immILHUvec: Predicate test for a ILHU constant vector.
420 def immILHUvec_i64: PatLeaf<(build_vector), [{
421 return SPU::get_ILHUvec_imm(N, *CurDAG, MVT::i64).getNode() != 0;
422 }], ILHUvec_get_imm>;
424 // Catch-all for any other i32 vector constants
425 def v2i64_get_imm: SDNodeXForm<build_vector, [{
426 return SPU::get_v2i64_imm(N, *CurDAG);
429 def v2i64Imm: PatLeaf<(build_vector), [{
430 return SPU::get_v2i64_imm(N, *CurDAG).getNode() != 0;
433 //===----------------------------------------------------------------------===//
434 // Operand Definitions.
436 def s7imm: Operand<i8> {
437 let PrintMethod = "printS7ImmOperand";
440 def s7imm_i8: Operand<i8> {
441 let PrintMethod = "printS7ImmOperand";
444 def u7imm: Operand<i16> {
445 let PrintMethod = "printU7ImmOperand";
448 def u7imm_i8: Operand<i8> {
449 let PrintMethod = "printU7ImmOperand";
452 def u7imm_i32: Operand<i32> {
453 let PrintMethod = "printU7ImmOperand";
456 // Halfword, signed 10-bit constant
457 def s10imm : Operand<i16> {
458 let PrintMethod = "printS10ImmOperand";
461 def s10imm_i8: Operand<i8> {
462 let PrintMethod = "printS10ImmOperand";
465 def s10imm_i32: Operand<i32> {
466 let PrintMethod = "printS10ImmOperand";
469 def s10imm_i64: Operand<i64> {
470 let PrintMethod = "printS10ImmOperand";
473 // Unsigned 10-bit integers:
474 def u10imm: Operand<i16> {
475 let PrintMethod = "printU10ImmOperand";
478 def u10imm_i8: Operand<i8> {
479 let PrintMethod = "printU10ImmOperand";
482 def u10imm_i32: Operand<i32> {
483 let PrintMethod = "printU10ImmOperand";
486 def s16imm : Operand<i16> {
487 let PrintMethod = "printS16ImmOperand";
490 def s16imm_i8: Operand<i8> {
491 let PrintMethod = "printS16ImmOperand";
494 def s16imm_i32: Operand<i32> {
495 let PrintMethod = "printS16ImmOperand";
498 def s16imm_i64: Operand<i64> {
499 let PrintMethod = "printS16ImmOperand";
502 def s16imm_f32: Operand<f32> {
503 let PrintMethod = "printS16ImmOperand";
506 def s16imm_f64: Operand<f64> {
507 let PrintMethod = "printS16ImmOperand";
510 def u16imm_i64 : Operand<i64> {
511 let PrintMethod = "printU16ImmOperand";
514 def u16imm_i32 : Operand<i32> {
515 let PrintMethod = "printU16ImmOperand";
518 def u16imm : Operand<i16> {
519 let PrintMethod = "printU16ImmOperand";
522 def f16imm : Operand<f32> {
523 let PrintMethod = "printU16ImmOperand";
526 def s18imm : Operand<i32> {
527 let PrintMethod = "printS18ImmOperand";
530 def u18imm : Operand<i32> {
531 let PrintMethod = "printU18ImmOperand";
534 def u18imm_i64 : Operand<i64> {
535 let PrintMethod = "printU18ImmOperand";
538 def f18imm : Operand<f32> {
539 let PrintMethod = "printU18ImmOperand";
542 def f18imm_f64 : Operand<f64> {
543 let PrintMethod = "printU18ImmOperand";
546 // Negated 7-bit halfword rotate immediate operands
547 def rothNeg7imm : Operand<i32> {
548 let PrintMethod = "printROTHNeg7Imm";
551 def rothNeg7imm_i16 : Operand<i16> {
552 let PrintMethod = "printROTHNeg7Imm";
555 // Negated 7-bit word rotate immediate operands
556 def rotNeg7imm : Operand<i32> {
557 let PrintMethod = "printROTNeg7Imm";
560 def rotNeg7imm_i16 : Operand<i16> {
561 let PrintMethod = "printROTNeg7Imm";
564 def rotNeg7imm_i8 : Operand<i8> {
565 let PrintMethod = "printROTNeg7Imm";
568 def target : Operand<OtherVT> {
569 let PrintMethod = "printBranchOperand";
572 // Absolute address call target
573 def calltarget : Operand<iPTR> {
574 let PrintMethod = "printCallOperand";
575 let MIOperandInfo = (ops u18imm:$calldest);
578 // PC relative call target
579 def relcalltarget : Operand<iPTR> {
580 let PrintMethod = "printPCRelativeOperand";
581 let MIOperandInfo = (ops s16imm:$calldest);
585 def brtarget : Operand<OtherVT> {
586 let PrintMethod = "printPCRelativeOperand";
589 // Hint for branch target
590 def hbrtarget : Operand<OtherVT> {
591 let PrintMethod = "printHBROperand";
594 // Indirect call target
595 def indcalltarget : Operand<iPTR> {
596 let PrintMethod = "printCallOperand";
597 let MIOperandInfo = (ops ptr_rc:$calldest);
600 def symbolHi: Operand<i32> {
601 let PrintMethod = "printSymbolHi";
604 def symbolLo: Operand<i32> {
605 let PrintMethod = "printSymbolLo";
608 def symbolLSA: Operand<i32> {
609 let PrintMethod = "printSymbolLSA";
612 // Shuffle address memory operaand [s7imm(reg) d-format]
613 def shufaddr : Operand<iPTR> {
614 let PrintMethod = "printShufAddr";
615 let MIOperandInfo = (ops s7imm:$imm, ptr_rc:$reg);
618 // memory s10imm(reg) operand
619 def dformaddr : Operand<iPTR> {
620 let PrintMethod = "printDFormAddr";
621 let MIOperandInfo = (ops s10imm:$imm, ptr_rc:$reg);
624 // 256K local store address
625 // N.B.: The tblgen code generator expects to have two operands, an offset
626 // and a pointer. Of these, only the immediate is actually used.
627 def addr256k : Operand<iPTR> {
628 let PrintMethod = "printAddr256K";
629 let MIOperandInfo = (ops s16imm:$imm, ptr_rc:$reg);
632 // memory s18imm(reg) operand
633 def memri18 : Operand<iPTR> {
634 let PrintMethod = "printMemRegImmS18";
635 let MIOperandInfo = (ops s18imm:$imm, ptr_rc:$reg);
638 // memory register + register operand
639 def memrr : Operand<iPTR> {
640 let PrintMethod = "printMemRegReg";
641 let MIOperandInfo = (ops ptr_rc:$reg_a, ptr_rc:$reg_b);
644 // Define SPU-specific addressing modes: These come in three basic
647 // D-form : [r+I10] (10-bit signed offset + reg)
648 // X-form : [r+r] (reg+reg)
649 // A-form : abs (256K LSA offset)
650 // D-form(2): [r+I7] (7-bit signed offset + reg)
652 def dform_addr : ComplexPattern<iPTR, 2, "SelectDFormAddr", [], []>;
653 def xform_addr : ComplexPattern<iPTR, 2, "SelectXFormAddr", [], []>;
654 def aform_addr : ComplexPattern<iPTR, 2, "SelectAFormAddr", [], []>;
655 def dform2_addr : ComplexPattern<iPTR, 2, "SelectDForm2Addr", [], []>;