Adding a v8i64 512-bit vector type. This will be used to model ARM NEON intrinsics...
[oota-llvm.git] / include / llvm / CodeGen / ValueTypes.h
1 //===- CodeGen/ValueTypes.h - Low-Level Target independ. types --*- C++ -*-===//
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 // This file defines the set of low-level target independent types which various
11 // values in the code generator are.  This allows the target specific behavior
12 // of instructions to be described to target independent passes.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CODEGEN_VALUETYPES_H
17 #define LLVM_CODEGEN_VALUETYPES_H
18
19 #include <cassert>
20 #include <string>
21 #include "llvm/System/DataTypes.h"
22 #include "llvm/Support/MathExtras.h"
23
24 namespace llvm {
25   class Type;
26   class LLVMContext;
27   struct EVT;
28
29   class MVT { // MVT = Machine Value Type
30   public:
31     enum SimpleValueType {
32       // If you change this numbering, you must change the values in
33       // ValueTypes.td as well!
34       Other          =   0,   // This is a non-standard value
35       i1             =   1,   // This is a 1 bit integer value
36       i8             =   2,   // This is an 8 bit integer value
37       i16            =   3,   // This is a 16 bit integer value
38       i32            =   4,   // This is a 32 bit integer value
39       i64            =   5,   // This is a 64 bit integer value
40       i128           =   6,   // This is a 128 bit integer value
41
42       FIRST_INTEGER_VALUETYPE = i1,
43       LAST_INTEGER_VALUETYPE  = i128,
44
45       f32            =   7,   // This is a 32 bit floating point value
46       f64            =   8,   // This is a 64 bit floating point value
47       f80            =   9,   // This is a 80 bit floating point value
48       f128           =  10,   // This is a 128 bit floating point value
49       ppcf128        =  11,   // This is a PPC 128-bit floating point value
50
51       v2i8           =  12,   //  2 x i8
52       v4i8           =  13,   //  4 x i8
53       v8i8           =  14,   //  8 x i8
54       v16i8          =  15,   // 16 x i8
55       v32i8          =  16,   // 32 x i8
56       v2i16          =  17,   //  2 x i16
57       v4i16          =  18,   //  4 x i16
58       v8i16          =  19,   //  8 x i16
59       v16i16         =  20,   // 16 x i16
60       v2i32          =  21,   //  2 x i32
61       v4i32          =  22,   //  4 x i32
62       v8i32          =  23,   //  8 x i32
63       v1i64          =  24,   //  1 x i64
64       v2i64          =  25,   //  2 x i64
65       v4i64          =  26,   //  4 x i64
66       v8i64          =  27,   //  8 x i64
67
68       v2f32          =  28,   //  2 x f32
69       v4f32          =  29,   //  4 x f32
70       v8f32          =  30,   //  8 x f32
71       v2f64          =  31,   //  2 x f64
72       v4f64          =  32,   //  4 x f64
73
74       FIRST_VECTOR_VALUETYPE = v2i8,
75       LAST_VECTOR_VALUETYPE  = v4f64,
76
77       Flag           =  33,   // This glues nodes together during pre-RA sched
78
79       isVoid         =  34,   // This has no value
80
81       LAST_VALUETYPE =  34,   // This always remains at the end of the list.
82
83       // This is the current maximum for LAST_VALUETYPE.
84       // EVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
85       // This value must be a multiple of 32.
86       MAX_ALLOWED_VALUETYPE = 64,
87
88       // Metadata - This is MDNode or MDString.
89       Metadata       = 250,
90
91       // iPTRAny - An int value the size of the pointer of the current
92       // target to any address space. This must only be used internal to
93       // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
94       iPTRAny        = 251,
95
96       // vAny - A vector with any length and element size. This is used
97       // for intrinsics that have overloadings based on vector types.
98       // This is only for tblgen's consumption!
99       vAny           = 252,
100
101       // fAny - Any floating-point or vector floating-point value. This is used
102       // for intrinsics that have overloadings based on floating-point types.
103       // This is only for tblgen's consumption!
104       fAny           = 253,
105
106       // iAny - An integer or vector integer value of any bit width. This is
107       // used for intrinsics that have overloadings based on integer bit widths.
108       // This is only for tblgen's consumption!
109       iAny           = 254,
110
111       // iPTR - An int value the size of the pointer of the current
112       // target.  This should only be used internal to tblgen!
113       iPTR           = 255,
114
115       // LastSimpleValueType - The greatest valid SimpleValueType value.
116       LastSimpleValueType = 255,
117
118       // INVALID_SIMPLE_VALUE_TYPE - Simple value types greater than or equal
119       // to this are considered extended value types.
120       INVALID_SIMPLE_VALUE_TYPE = LastSimpleValueType + 1
121     };
122
123     SimpleValueType SimpleTy;
124
125     MVT() : SimpleTy((SimpleValueType)(INVALID_SIMPLE_VALUE_TYPE)) {}
126     MVT(SimpleValueType SVT) : SimpleTy(SVT) { }
127     
128     bool operator>(const MVT& S)  const { return SimpleTy >  S.SimpleTy; }
129     bool operator<(const MVT& S)  const { return SimpleTy <  S.SimpleTy; }
130     bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
131     bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
132     bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
133     
134     /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
135     bool isFloatingPoint() const {
136       return ((SimpleTy >= MVT::f32 && SimpleTy <= MVT::ppcf128) ||
137         (SimpleTy >= MVT::v2f32 && SimpleTy <= MVT::v4f64));
138     }
139
140     /// isInteger - Return true if this is an integer, or a vector integer type.
141     bool isInteger() const {
142       return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
143                SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
144                (SimpleTy >= MVT::v2i8 && SimpleTy <= MVT::v8i64));
145     }
146
147     /// isVector - Return true if this is a vector value type.
148     bool isVector() const {
149       return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
150               SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
151     }
152     
153     /// isPow2VectorType - Returns true if the given vector is a power of 2.
154     bool isPow2VectorType() const {
155       unsigned NElts = getVectorNumElements();
156       return !(NElts & (NElts - 1));
157     }
158
159     /// getPow2VectorType - Widens the length of the given vector EVT up to
160     /// the nearest power of 2 and returns that type.
161     MVT getPow2VectorType() const {
162       if (!isPow2VectorType()) {
163         unsigned NElts = getVectorNumElements();
164         unsigned Pow2NElts = 1 <<  Log2_32_Ceil(NElts);
165         return MVT::getVectorVT(getVectorElementType(), Pow2NElts);
166       }
167       else {
168         return *this;
169       }
170     }
171
172     /// getScalarType - If this is a vector type, return the element type,
173     /// otherwise return this.
174     MVT getScalarType() const {
175       return isVector() ? getVectorElementType() : *this;
176     }
177     
178     MVT getVectorElementType() const {
179       switch (SimpleTy) {
180       default:
181         return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
182       case v2i8 :
183       case v4i8 :
184       case v8i8 :
185       case v16i8:
186       case v32i8: return i8;
187       case v2i16:
188       case v4i16:
189       case v8i16:
190       case v16i16: return i16;
191       case v2i32:
192       case v4i32:
193       case v8i32: return i32;
194       case v1i64:
195       case v2i64:
196       case v4i64:
197       case v8i64: return i64;
198       case v2f32:
199       case v4f32:
200       case v8f32: return f32;
201       case v2f64:
202       case v4f64: return f64;
203       }
204     }
205     
206     unsigned getVectorNumElements() const {
207       switch (SimpleTy) {
208       default:
209         return ~0U;
210       case v32i8: return 32;
211       case v16i8:
212       case v16i16: return 16;
213       case v8i8 :
214       case v8i16:
215       case v8i32:
216       case v8i64:
217       case v8f32: return 8;
218       case v4i8:
219       case v4i16:
220       case v4i32:
221       case v4i64:
222       case v4f32:
223       case v4f64: return 4;
224       case v2i8:
225       case v2i16:
226       case v2i32:
227       case v2i64:
228       case v2f32:
229       case v2f64: return 2;
230       case v1i64: return 1;
231       }
232     }
233     
234     unsigned getSizeInBits() const {
235       switch (SimpleTy) {
236       case iPTR:
237         assert(0 && "Value type size is target-dependent. Ask TLI.");
238       case iPTRAny:
239       case iAny:
240       case fAny:
241         assert(0 && "Value type is overloaded.");
242       default:
243         assert(0 && "getSizeInBits called on extended MVT.");
244       case i1  :  return 1;
245       case i8  :  return 8;
246       case i16 :
247       case v2i8:  return 16;
248       case f32 :
249       case i32 :
250       case v4i8:
251       case v2i16: return 32;
252       case f64 :
253       case i64 :
254       case v8i8:
255       case v4i16:
256       case v2i32:
257       case v1i64:
258       case v2f32: return 64;
259       case f80 :  return 80;
260       case f128:
261       case ppcf128:
262       case i128:
263       case v16i8:
264       case v8i16:
265       case v4i32:
266       case v2i64:
267       case v4f32:
268       case v2f64: return 128;
269       case v32i8:
270       case v16i16:
271       case v8i32:
272       case v4i64:
273       case v8f32:
274       case v4f64: return 256;
275       case v8i64: return 512;
276       }
277     }
278     
279     static MVT getFloatingPointVT(unsigned BitWidth) {
280       switch (BitWidth) {
281       default:
282         assert(false && "Bad bit width!");
283       case 32:
284         return MVT::f32;
285       case 64:
286         return MVT::f64;
287       case 80:
288         return MVT::f80;
289       case 128:
290         return MVT::f128;
291       }
292     }
293     
294     static MVT getIntegerVT(unsigned BitWidth) {
295       switch (BitWidth) {
296       default:
297         return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
298       case 1:
299         return MVT::i1;
300       case 8:
301         return MVT::i8;
302       case 16:
303         return MVT::i16;
304       case 32:
305         return MVT::i32;
306       case 64:
307         return MVT::i64;
308       case 128:
309         return MVT::i128;
310       }
311     }
312     
313     static MVT getVectorVT(MVT VT, unsigned NumElements) {
314       switch (VT.SimpleTy) {
315       default:
316         break;
317       case MVT::i8:
318         if (NumElements == 2)  return MVT::v2i8;
319         if (NumElements == 4)  return MVT::v4i8;
320         if (NumElements == 8)  return MVT::v8i8;
321         if (NumElements == 16) return MVT::v16i8;
322         if (NumElements == 32) return MVT::v32i8;
323         break;
324       case MVT::i16:
325         if (NumElements == 2)  return MVT::v2i16;
326         if (NumElements == 4)  return MVT::v4i16;
327         if (NumElements == 8)  return MVT::v8i16;
328         if (NumElements == 16) return MVT::v16i16;
329         break;
330       case MVT::i32:
331         if (NumElements == 2)  return MVT::v2i32;
332         if (NumElements == 4)  return MVT::v4i32;
333         if (NumElements == 8)  return MVT::v8i32;
334         break;
335       case MVT::i64:
336         if (NumElements == 1)  return MVT::v1i64;
337         if (NumElements == 2)  return MVT::v2i64;
338         if (NumElements == 4)  return MVT::v4i64;
339         if (NumElements == 8)  return MVT::v8i64;
340         break;
341       case MVT::f32:
342         if (NumElements == 2)  return MVT::v2f32;
343         if (NumElements == 4)  return MVT::v4f32;
344         if (NumElements == 8)  return MVT::v8f32;
345         break;
346       case MVT::f64:
347         if (NumElements == 2)  return MVT::v2f64;
348         if (NumElements == 4)  return MVT::v4f64;
349         break;
350       }
351       return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
352     }
353     
354     static MVT getIntVectorWithNumElements(unsigned NumElts) {
355       switch (NumElts) {
356       default: return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
357       case  1: return MVT::v1i64;
358       case  2: return MVT::v2i32;
359       case  4: return MVT::v4i16;
360       case  8: return MVT::v8i8;
361       case 16: return MVT::v16i8;
362       }
363     }
364   };
365
366   struct EVT { // EVT = Extended Value Type
367   private:
368     MVT V;
369     const Type *LLVMTy;
370
371   public:
372     EVT() : V((MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE)),
373             LLVMTy(0) {}
374     EVT(MVT::SimpleValueType SVT) : V(SVT), LLVMTy(0) { }
375     EVT(MVT S) : V(S), LLVMTy(0) {}
376
377     bool operator==(const EVT VT) const {
378       if (V.SimpleTy == VT.V.SimpleTy) {
379         if (V.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
380           return LLVMTy == VT.LLVMTy;
381         return true;
382       }
383       return false;
384     }
385     bool operator!=(const EVT VT) const {
386       if (V.SimpleTy == VT.V.SimpleTy) {
387         if (V.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
388           return LLVMTy != VT.LLVMTy;
389         return false;
390       }
391       return true;
392     }
393
394     /// getFloatingPointVT - Returns the EVT that represents a floating point
395     /// type with the given number of bits.  There are two floating point types
396     /// with 128 bits - this returns f128 rather than ppcf128.
397     static EVT getFloatingPointVT(unsigned BitWidth) {
398       return MVT::getFloatingPointVT(BitWidth);
399     }
400
401     /// getIntegerVT - Returns the EVT that represents an integer with the given
402     /// number of bits.
403     static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth) {
404       MVT M = MVT::getIntegerVT(BitWidth);
405       if (M.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
406         return getExtendedIntegerVT(Context, BitWidth);
407       else
408         return M;
409     }
410
411     /// getVectorVT - Returns the EVT that represents a vector NumElements in
412     /// length, where each element is of type VT.
413     static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements) {
414       MVT M = MVT::getVectorVT(VT.V, NumElements);
415       if (M.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
416         return getExtendedVectorVT(Context, VT, NumElements);
417       else
418         return M;
419     }
420
421     /// getIntVectorWithNumElements - Return any integer vector type that has
422     /// the specified number of elements.
423     static EVT getIntVectorWithNumElements(LLVMContext &C, unsigned NumElts) {
424       MVT M = MVT::getIntVectorWithNumElements(NumElts);
425       if (M.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
426         return getVectorVT(C, MVT::i8, NumElts);
427       else
428         return M;
429     }
430
431     /// isSimple - Test if the given EVT is simple (as opposed to being
432     /// extended).
433     bool isSimple() const {
434       return V.SimpleTy <= MVT::LastSimpleValueType;
435     }
436
437     /// isExtended - Test if the given EVT is extended (as opposed to
438     /// being simple).
439     bool isExtended() const {
440       return !isSimple();
441     }
442
443     /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
444     bool isFloatingPoint() const {
445       return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
446     }
447
448     /// isInteger - Return true if this is an integer, or a vector integer type.
449     bool isInteger() const {
450       return isSimple() ? V.isInteger() : isExtendedInteger();
451     }
452
453     /// isVector - Return true if this is a vector value type.
454     bool isVector() const {
455       return isSimple() ? V.isVector() : isExtendedVector();
456     }
457
458     /// is64BitVector - Return true if this is a 64-bit vector type.
459     bool is64BitVector() const {
460       return isSimple() ?
461              (V==MVT::v8i8 || V==MVT::v4i16 || V==MVT::v2i32 ||
462               V==MVT::v1i64 || V==MVT::v2f32) :
463              isExtended64BitVector();
464     }
465
466     /// is128BitVector - Return true if this is a 128-bit vector type.
467     bool is128BitVector() const {
468       return isSimple() ?
469              (V==MVT::v16i8 || V==MVT::v8i16 || V==MVT::v4i32 ||
470               V==MVT::v2i64 || V==MVT::v4f32 || V==MVT::v2f64) :
471              isExtended128BitVector();
472     }
473
474     /// is256BitVector - Return true if this is a 256-bit vector type.
475     inline bool is256BitVector() const {
476       return isSimple()
477         ? (V==MVT::v8f32 || V==MVT::v4f64 || V==MVT::v32i8 ||
478            V==MVT::v16i16 || V==MVT::v8i32 || V==MVT::v4i64)
479         : isExtended256BitVector();
480     }
481
482     /// is512BitVector - Return true if this is a 512-bit vector type.
483     inline bool is512BitVector() const {
484       return isSimple() ? (V == MVT::v8i64) : isExtended512BitVector();
485     }
486
487     /// isOverloaded - Return true if this is an overloaded type for TableGen.
488     bool isOverloaded() const {
489       return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
490     }
491
492     /// isByteSized - Return true if the bit size is a multiple of 8.
493     bool isByteSized() const {
494       return (getSizeInBits() & 7) == 0;
495     }
496
497     /// isRound - Return true if the size is a power-of-two number of bytes.
498     bool isRound() const {
499       unsigned BitSize = getSizeInBits();
500       return BitSize >= 8 && !(BitSize & (BitSize - 1));
501     }
502
503     /// bitsEq - Return true if this has the same number of bits as VT.
504     bool bitsEq(EVT VT) const {
505       if (EVT::operator==(VT)) return true;
506       return getSizeInBits() == VT.getSizeInBits();
507     }
508
509     /// bitsGT - Return true if this has more bits than VT.
510     bool bitsGT(EVT VT) const {
511       if (EVT::operator==(VT)) return false;
512       return getSizeInBits() > VT.getSizeInBits();
513     }
514
515     /// bitsGE - Return true if this has no less bits than VT.
516     bool bitsGE(EVT VT) const {
517       if (EVT::operator==(VT)) return true;
518       return getSizeInBits() >= VT.getSizeInBits();
519     }
520
521     /// bitsLT - Return true if this has less bits than VT.
522     bool bitsLT(EVT VT) const {
523       if (EVT::operator==(VT)) return false;
524       return getSizeInBits() < VT.getSizeInBits();
525     }
526
527     /// bitsLE - Return true if this has no more bits than VT.
528     bool bitsLE(EVT VT) const {
529       if (EVT::operator==(VT)) return true;
530       return getSizeInBits() <= VT.getSizeInBits();
531     }
532
533
534     /// getSimpleVT - Return the SimpleValueType held in the specified
535     /// simple EVT.
536     MVT getSimpleVT() const {
537       assert(isSimple() && "Expected a SimpleValueType!");
538       return V;
539     }
540
541     /// getScalarType - If this is a vector type, return the element type,
542     /// otherwise return this.
543     EVT getScalarType() const {
544       return isVector() ? getVectorElementType() : *this;
545     }
546     
547     /// getVectorElementType - Given a vector type, return the type of
548     /// each element.
549     EVT getVectorElementType() const {
550       assert(isVector() && "Invalid vector type!");
551       if (isSimple())
552         return V.getVectorElementType();
553       else
554         return getExtendedVectorElementType();
555     }
556
557     /// getVectorNumElements - Given a vector type, return the number of
558     /// elements it contains.
559     unsigned getVectorNumElements() const {
560       assert(isVector() && "Invalid vector type!");
561       if (isSimple())
562         return V.getVectorNumElements();
563       else
564         return getExtendedVectorNumElements();
565     }
566
567     /// getSizeInBits - Return the size of the specified value type in bits.
568     unsigned getSizeInBits() const {
569       if (isSimple())
570         return V.getSizeInBits();
571       else
572         return getExtendedSizeInBits();
573     }
574
575     /// getStoreSize - Return the number of bytes overwritten by a store
576     /// of the specified value type.
577     unsigned getStoreSize() const {
578       return (getSizeInBits() + 7) / 8;
579     }
580
581     /// getStoreSizeInBits - Return the number of bits overwritten by a store
582     /// of the specified value type.
583     unsigned getStoreSizeInBits() const {
584       return getStoreSize() * 8;
585     }
586
587     /// getRoundIntegerType - Rounds the bit-width of the given integer EVT up
588     /// to the nearest power of two (and at least to eight), and returns the
589     /// integer EVT with that number of bits.
590     EVT getRoundIntegerType(LLVMContext &Context) const {
591       assert(isInteger() && !isVector() && "Invalid integer type!");
592       unsigned BitWidth = getSizeInBits();
593       if (BitWidth <= 8)
594         return EVT(MVT::i8);
595       else
596         return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
597     }
598
599     /// getHalfSizedIntegerVT - Finds the smallest simple value type that is
600     /// greater than or equal to half the width of this EVT. If no simple
601     /// value type can be found, an extended integer value type of half the
602     /// size (rounded up) is returned.
603     EVT getHalfSizedIntegerVT(LLVMContext &Context) const {
604       assert(isInteger() && !isVector() && "Invalid integer type!");
605       unsigned EVTSize = getSizeInBits();
606       for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
607           IntVT <= MVT::LAST_INTEGER_VALUETYPE;
608           ++IntVT) {
609         EVT HalfVT = EVT((MVT::SimpleValueType)IntVT);
610         if(HalfVT.getSizeInBits() * 2 >= EVTSize) { 
611           return HalfVT;
612         }
613       }
614       return getIntegerVT(Context, (EVTSize + 1) / 2);
615     }
616
617     /// isPow2VectorType - Returns true if the given vector is a power of 2.
618     bool isPow2VectorType() const {
619       unsigned NElts = getVectorNumElements();
620       return !(NElts & (NElts - 1));
621     }
622
623     /// getPow2VectorType - Widens the length of the given vector EVT up to
624     /// the nearest power of 2 and returns that type.
625     EVT getPow2VectorType(LLVMContext &Context) const {
626       if (!isPow2VectorType()) {
627         unsigned NElts = getVectorNumElements();
628         unsigned Pow2NElts = 1 <<  Log2_32_Ceil(NElts);
629         return EVT::getVectorVT(Context, getVectorElementType(), Pow2NElts);
630       }
631       else {
632         return *this;
633       }
634     }
635
636     /// getEVTString - This function returns value type as a string,
637     /// e.g. "i32".
638     std::string getEVTString() const;
639
640     /// getTypeForEVT - This method returns an LLVM type corresponding to the
641     /// specified EVT.  For integer types, this returns an unsigned type.  Note
642     /// that this will abort for types that cannot be represented.
643     const Type *getTypeForEVT(LLVMContext &Context) const;
644
645     /// getEVT - Return the value type corresponding to the specified type.
646     /// This returns all pointers as iPTR.  If HandleUnknown is true, unknown
647     /// types are returned as Other, otherwise they are invalid.
648     static EVT getEVT(const Type *Ty, bool HandleUnknown = false);
649
650     intptr_t getRawBits() {
651       if (isSimple())
652         return V.SimpleTy;
653       else
654         return (intptr_t)(LLVMTy);
655     }
656
657     /// compareRawBits - A meaningless but well-behaved order, useful for
658     /// constructing containers.
659     struct compareRawBits {
660       bool operator()(EVT L, EVT R) const {
661         if (L.V.SimpleTy == R.V.SimpleTy)
662           return L.LLVMTy < R.LLVMTy;
663         else
664           return L.V.SimpleTy < R.V.SimpleTy;
665       }
666     };
667
668   private:
669     // Methods for handling the Extended-type case in functions above.
670     // These are all out-of-line to prevent users of this header file
671     // from having a dependency on Type.h.
672     static EVT getExtendedIntegerVT(LLVMContext &C, unsigned BitWidth);
673     static EVT getExtendedVectorVT(LLVMContext &C, EVT VT,
674                                    unsigned NumElements);
675     bool isExtendedFloatingPoint() const;
676     bool isExtendedInteger() const;
677     bool isExtendedVector() const;
678     bool isExtended64BitVector() const;
679     bool isExtended128BitVector() const;
680     bool isExtended256BitVector() const;
681     bool isExtended512BitVector() const;
682     EVT getExtendedVectorElementType() const;
683     unsigned getExtendedVectorNumElements() const;
684     unsigned getExtendedSizeInBits() const;
685   };
686
687 } // End llvm namespace
688
689 #endif