1 //===- CodeGen/ValueTypes.h - Low-Level Target independ. types --*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CODEGEN_VALUETYPES_H
17 #define LLVM_CODEGEN_VALUETYPES_H
19 #include "llvm/Support/DataTypes.h"
20 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Support/MathExtras.h"
30 /// MVT - Machine Value Type. Every type that is supported natively by some
31 /// processor targeted by LLVM occurs here. This means that any legal value
32 /// type can be represented by a MVT.
35 enum SimpleValueType {
36 // If you change this numbering, you must change the values in
37 // ValueTypes.td as well!
38 Other = 0, // This is a non-standard value
39 i1 = 1, // This is a 1 bit integer value
40 i8 = 2, // This is an 8 bit integer value
41 i16 = 3, // This is a 16 bit integer value
42 i32 = 4, // This is a 32 bit integer value
43 i64 = 5, // This is a 64 bit integer value
44 i128 = 6, // This is a 128 bit integer value
46 FIRST_INTEGER_VALUETYPE = i1,
47 LAST_INTEGER_VALUETYPE = i128,
49 f16 = 7, // This is a 16 bit floating point value
50 f32 = 8, // This is a 32 bit floating point value
51 f64 = 9, // This is a 64 bit floating point value
52 f80 = 10, // This is a 80 bit floating point value
53 f128 = 11, // This is a 128 bit floating point value
54 ppcf128 = 12, // This is a PPC 128-bit floating point value
56 FIRST_FP_VALUETYPE = f16,
57 LAST_FP_VALUETYPE = ppcf128,
62 v16i1 = 16, // 16 x i1
66 v16i8 = 20, // 16 x i8
67 v32i8 = 21, // 32 x i8
68 v1i16 = 22, // 1 x i16
69 v2i16 = 23, // 2 x i16
70 v4i16 = 24, // 4 x i16
71 v8i16 = 25, // 8 x i16
72 v16i16 = 26, // 16 x i16
73 v1i32 = 27, // 1 x i32
74 v2i32 = 28, // 2 x i32
75 v4i32 = 29, // 4 x i32
76 v8i32 = 30, // 8 x i32
77 v16i32 = 31, // 16 x i32
78 v1i64 = 32, // 1 x i64
79 v2i64 = 33, // 2 x i64
80 v4i64 = 34, // 4 x i64
81 v8i64 = 35, // 8 x i64
82 v16i64 = 36, // 16 x i64
84 v2f16 = 37, // 2 x f16
85 v2f32 = 38, // 2 x f32
86 v4f32 = 39, // 4 x f32
87 v8f32 = 40, // 8 x f32
88 v2f64 = 41, // 2 x f64
89 v4f64 = 42, // 4 x f64
91 FIRST_VECTOR_VALUETYPE = v2i1,
92 LAST_VECTOR_VALUETYPE = v4f64,
93 FIRST_INTEGER_VECTOR_VALUETYPE = v2i1,
94 LAST_INTEGER_VECTOR_VALUETYPE = v16i64,
95 FIRST_FP_VECTOR_VALUETYPE = v2f16,
96 LAST_FP_VECTOR_VALUETYPE = v4f64,
98 x86mmx = 43, // This is an X86 MMX value
100 Glue = 44, // This glues nodes together during pre-RA sched
102 isVoid = 45, // This has no value
104 Untyped = 46, // This value takes a register, but has
105 // unspecified type. The register class
106 // will be determined by the opcode.
108 LAST_VALUETYPE = 47, // This always remains at the end of the list.
110 // This is the current maximum for LAST_VALUETYPE.
111 // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
112 // This value must be a multiple of 32.
113 MAX_ALLOWED_VALUETYPE = 64,
115 // Metadata - This is MDNode or MDString.
118 // iPTRAny - An int value the size of the pointer of the current
119 // target to any address space. This must only be used internal to
120 // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
123 // vAny - A vector with any length and element size. This is used
124 // for intrinsics that have overloadings based on vector types.
125 // This is only for tblgen's consumption!
128 // fAny - Any floating-point or vector floating-point value. This is used
129 // for intrinsics that have overloadings based on floating-point types.
130 // This is only for tblgen's consumption!
133 // iAny - An integer or vector integer value of any bit width. This is
134 // used for intrinsics that have overloadings based on integer bit widths.
135 // This is only for tblgen's consumption!
138 // iPTR - An int value the size of the pointer of the current
139 // target. This should only be used internal to tblgen!
142 // LastSimpleValueType - The greatest valid SimpleValueType value.
143 LastSimpleValueType = 255,
145 // INVALID_SIMPLE_VALUE_TYPE - Simple value types greater than or equal
146 // to this are considered extended value types.
147 INVALID_SIMPLE_VALUE_TYPE = LastSimpleValueType + 1
150 SimpleValueType SimpleTy;
152 MVT() : SimpleTy((SimpleValueType)(INVALID_SIMPLE_VALUE_TYPE)) {}
153 MVT(SimpleValueType SVT) : SimpleTy(SVT) { }
155 bool operator>(const MVT& S) const { return SimpleTy > S.SimpleTy; }
156 bool operator<(const MVT& S) const { return SimpleTy < S.SimpleTy; }
157 bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
158 bool operator!=(const MVT& S) const { return SimpleTy != S.SimpleTy; }
159 bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
160 bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
162 /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
163 bool isFloatingPoint() const {
164 return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
165 SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
166 (SimpleTy >= MVT::FIRST_FP_VECTOR_VALUETYPE &&
167 SimpleTy <= MVT::LAST_FP_VECTOR_VALUETYPE));
170 /// isInteger - Return true if this is an integer, or a vector integer type.
171 bool isInteger() const {
172 return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
173 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
174 (SimpleTy >= MVT::FIRST_INTEGER_VECTOR_VALUETYPE &&
175 SimpleTy <= MVT::LAST_INTEGER_VECTOR_VALUETYPE));
178 /// isVector - Return true if this is a vector value type.
179 bool isVector() const {
180 return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
181 SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
184 /// is16BitVector - Return true if this is a 16-bit vector type.
185 bool is16BitVector() const {
186 return (SimpleTy == MVT::v2i8 || SimpleTy == MVT::v1i16 ||
187 SimpleTy == MVT::v16i1);
190 /// is32BitVector - Return true if this is a 32-bit vector type.
191 bool is32BitVector() const {
192 return (SimpleTy == MVT::v4i8 || SimpleTy == MVT::v2i16 ||
193 SimpleTy == MVT::v1i32);
196 /// is64BitVector - Return true if this is a 64-bit vector type.
197 bool is64BitVector() const {
198 return (SimpleTy == MVT::v8i8 || SimpleTy == MVT::v4i16 ||
199 SimpleTy == MVT::v2i32 || SimpleTy == MVT::v1i64 ||
200 SimpleTy == MVT::v2f32);
203 /// is128BitVector - Return true if this is a 128-bit vector type.
204 bool is128BitVector() const {
205 return (SimpleTy == MVT::v16i8 || SimpleTy == MVT::v8i16 ||
206 SimpleTy == MVT::v4i32 || SimpleTy == MVT::v2i64 ||
207 SimpleTy == MVT::v4f32 || SimpleTy == MVT::v2f64);
210 /// is256BitVector - Return true if this is a 256-bit vector type.
211 bool is256BitVector() const {
212 return (SimpleTy == MVT::v8f32 || SimpleTy == MVT::v4f64 ||
213 SimpleTy == MVT::v32i8 || SimpleTy == MVT::v16i16 ||
214 SimpleTy == MVT::v8i32 || SimpleTy == MVT::v4i64);
217 /// is512BitVector - Return true if this is a 512-bit vector type.
218 bool is512BitVector() const {
219 return (SimpleTy == MVT::v8i64 || SimpleTy == MVT::v16i32);
222 /// is1024BitVector - Return true if this is a 1024-bit vector type.
223 bool is1024BitVector() const {
224 return (SimpleTy == MVT::v16i64);
227 /// isPow2VectorType - Returns true if the given vector is a power of 2.
228 bool isPow2VectorType() const {
229 unsigned NElts = getVectorNumElements();
230 return !(NElts & (NElts - 1));
233 /// getPow2VectorType - Widens the length of the given vector MVT up to
234 /// the nearest power of 2 and returns that type.
235 MVT getPow2VectorType() const {
236 if (isPow2VectorType())
239 unsigned NElts = getVectorNumElements();
240 unsigned Pow2NElts = 1 << Log2_32_Ceil(NElts);
241 return MVT::getVectorVT(getVectorElementType(), Pow2NElts);
244 /// getScalarType - If this is a vector type, return the element type,
245 /// otherwise return this.
246 MVT getScalarType() const {
247 return isVector() ? getVectorElementType() : *this;
250 MVT getVectorElementType() const {
253 llvm_unreachable("Not a vector MVT!");
257 case v16i1: return i1;
262 case v32i8: return i8;
267 case v16i16: return i16;
272 case v16i32: return i32;
277 case v16i64: return i64;
278 case v2f16: return f16;
281 case v8f32: return f32;
283 case v4f64: return f64;
287 unsigned getVectorNumElements() const {
290 llvm_unreachable("Not a vector MVT!");
291 case v32i8: return 32;
296 case v16i64:return 16;
302 case v8f32: return 8;
309 case v4f64: return 4;
317 case v2f64: return 2;
320 case v1i64: return 1;
324 unsigned getSizeInBits() const {
327 llvm_unreachable("Value type size is target-dependent. Ask TLI.");
332 llvm_unreachable("Value type is overloaded.");
334 llvm_unreachable("Value type is metadata.");
336 llvm_unreachable("getSizeInBits called on extended MVT.");
346 case v1i16: return 16;
352 case v1i32: return 32;
360 case v2f32: return 64;
361 case f80 : return 80;
370 case v2f64: return 128;
376 case v4f64: return 256;
378 case v8i64: return 512;
379 case v16i64:return 1024;
383 /// getStoreSize - Return the number of bytes overwritten by a store
384 /// of the specified value type.
385 unsigned getStoreSize() const {
386 return (getSizeInBits() + 7) / 8;
389 /// getStoreSizeInBits - Return the number of bits overwritten by a store
390 /// of the specified value type.
391 unsigned getStoreSizeInBits() const {
392 return getStoreSize() * 8;
395 /// Return true if this has more bits than VT.
396 bool bitsGT(MVT VT) const {
397 return getSizeInBits() > VT.getSizeInBits();
400 /// Return true if this has no less bits than VT.
401 bool bitsGE(MVT VT) const {
402 return getSizeInBits() >= VT.getSizeInBits();
405 /// Return true if this has less bits than VT.
406 bool bitsLT(MVT VT) const {
407 return getSizeInBits() < VT.getSizeInBits();
410 /// Return true if this has no more bits than VT.
411 bool bitsLE(MVT VT) const {
412 return getSizeInBits() <= VT.getSizeInBits();
416 static MVT getFloatingPointVT(unsigned BitWidth) {
419 llvm_unreachable("Bad bit width!");
433 static MVT getIntegerVT(unsigned BitWidth) {
436 return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
452 static MVT getVectorVT(MVT VT, unsigned NumElements) {
453 switch (VT.SimpleTy) {
457 if (NumElements == 2) return MVT::v2i1;
458 if (NumElements == 4) return MVT::v4i1;
459 if (NumElements == 8) return MVT::v8i1;
460 if (NumElements == 16) return MVT::v16i1;
463 if (NumElements == 2) return MVT::v2i8;
464 if (NumElements == 4) return MVT::v4i8;
465 if (NumElements == 8) return MVT::v8i8;
466 if (NumElements == 16) return MVT::v16i8;
467 if (NumElements == 32) return MVT::v32i8;
470 if (NumElements == 1) return MVT::v1i16;
471 if (NumElements == 2) return MVT::v2i16;
472 if (NumElements == 4) return MVT::v4i16;
473 if (NumElements == 8) return MVT::v8i16;
474 if (NumElements == 16) return MVT::v16i16;
477 if (NumElements == 1) return MVT::v1i32;
478 if (NumElements == 2) return MVT::v2i32;
479 if (NumElements == 4) return MVT::v4i32;
480 if (NumElements == 8) return MVT::v8i32;
481 if (NumElements == 16) return MVT::v16i32;
484 if (NumElements == 1) return MVT::v1i64;
485 if (NumElements == 2) return MVT::v2i64;
486 if (NumElements == 4) return MVT::v4i64;
487 if (NumElements == 8) return MVT::v8i64;
488 if (NumElements == 16) return MVT::v16i64;
491 if (NumElements == 2) return MVT::v2f16;
494 if (NumElements == 2) return MVT::v2f32;
495 if (NumElements == 4) return MVT::v4f32;
496 if (NumElements == 8) return MVT::v8f32;
499 if (NumElements == 2) return MVT::v2f64;
500 if (NumElements == 4) return MVT::v4f64;
503 return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
506 /// Return the value type corresponding to the specified type. This returns
507 /// all pointers as iPTR. If HandleUnknown is true, unknown types are
508 /// returned as Other, otherwise they are invalid.
509 static MVT getVT(Type *Ty, bool HandleUnknown = false);
514 /// EVT - Extended Value Type. Capable of holding value types which are not
515 /// native for any processor (such as the i12345 type), as well as the types
516 /// a MVT can represent.
523 EVT() : V((MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE)),
525 EVT(MVT::SimpleValueType SVT) : V(SVT), LLVMTy(0) { }
526 EVT(MVT S) : V(S), LLVMTy(0) {}
528 bool operator==(EVT VT) const {
529 return !(*this != VT);
531 bool operator!=(EVT VT) const {
532 if (V.SimpleTy != VT.V.SimpleTy)
534 if (V.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
535 return LLVMTy != VT.LLVMTy;
539 /// getFloatingPointVT - Returns the EVT that represents a floating point
540 /// type with the given number of bits. There are two floating point types
541 /// with 128 bits - this returns f128 rather than ppcf128.
542 static EVT getFloatingPointVT(unsigned BitWidth) {
543 return MVT::getFloatingPointVT(BitWidth);
546 /// getIntegerVT - Returns the EVT that represents an integer with the given
548 static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth) {
549 MVT M = MVT::getIntegerVT(BitWidth);
550 if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
552 return getExtendedIntegerVT(Context, BitWidth);
555 /// getVectorVT - Returns the EVT that represents a vector NumElements in
556 /// length, where each element is of type VT.
557 static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements) {
558 MVT M = MVT::getVectorVT(VT.V, NumElements);
559 if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
561 return getExtendedVectorVT(Context, VT, NumElements);
564 /// changeVectorElementTypeToInteger - Return a vector with the same number
565 /// of elements as this vector, but with the element type converted to an
566 /// integer type with the same bitwidth.
567 EVT changeVectorElementTypeToInteger() const {
569 return changeExtendedVectorElementTypeToInteger();
570 MVT EltTy = getSimpleVT().getVectorElementType();
571 unsigned BitWidth = EltTy.getSizeInBits();
572 MVT IntTy = MVT::getIntegerVT(BitWidth);
573 MVT VecTy = MVT::getVectorVT(IntTy, getVectorNumElements());
574 assert(VecTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
575 "Simple vector VT not representable by simple integer vector VT!");
579 /// isSimple - Test if the given EVT is simple (as opposed to being
581 bool isSimple() const {
582 return V.SimpleTy <= MVT::LastSimpleValueType;
585 /// isExtended - Test if the given EVT is extended (as opposed to
587 bool isExtended() const {
591 /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
592 bool isFloatingPoint() const {
593 return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
596 /// isInteger - Return true if this is an integer, or a vector integer type.
597 bool isInteger() const {
598 return isSimple() ? V.isInteger() : isExtendedInteger();
601 /// isVector - Return true if this is a vector value type.
602 bool isVector() const {
603 return isSimple() ? V.isVector() : isExtendedVector();
606 /// is16BitVector - Return true if this is a 16-bit vector type.
607 bool is16BitVector() const {
608 return isSimple() ? V.is16BitVector() : isExtended16BitVector();
611 /// is32BitVector - Return true if this is a 32-bit vector type.
612 bool is32BitVector() const {
613 return isSimple() ? V.is32BitVector() : isExtended32BitVector();
616 /// is64BitVector - Return true if this is a 64-bit vector type.
617 bool is64BitVector() const {
618 return isSimple() ? V.is64BitVector() : isExtended64BitVector();
621 /// is128BitVector - Return true if this is a 128-bit vector type.
622 bool is128BitVector() const {
623 return isSimple() ? V.is128BitVector() : isExtended128BitVector();
626 /// is256BitVector - Return true if this is a 256-bit vector type.
627 bool is256BitVector() const {
628 return isSimple() ? V.is256BitVector() : isExtended256BitVector();
631 /// is512BitVector - Return true if this is a 512-bit vector type.
632 bool is512BitVector() const {
633 return isSimple() ? V.is512BitVector() : isExtended512BitVector();
636 /// is1024BitVector - Return true if this is a 1024-bit vector type.
637 bool is1024BitVector() const {
638 return isSimple() ? V.is1024BitVector() : isExtended1024BitVector();
641 /// isOverloaded - Return true if this is an overloaded type for TableGen.
642 bool isOverloaded() const {
643 return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
646 /// isByteSized - Return true if the bit size is a multiple of 8.
647 bool isByteSized() const {
648 return (getSizeInBits() & 7) == 0;
651 /// isRound - Return true if the size is a power-of-two number of bytes.
652 bool isRound() const {
653 unsigned BitSize = getSizeInBits();
654 return BitSize >= 8 && !(BitSize & (BitSize - 1));
657 /// bitsEq - Return true if this has the same number of bits as VT.
658 bool bitsEq(EVT VT) const {
659 if (EVT::operator==(VT)) return true;
660 return getSizeInBits() == VT.getSizeInBits();
663 /// bitsGT - Return true if this has more bits than VT.
664 bool bitsGT(EVT VT) const {
665 if (EVT::operator==(VT)) return false;
666 return getSizeInBits() > VT.getSizeInBits();
669 /// bitsGE - Return true if this has no less bits than VT.
670 bool bitsGE(EVT VT) const {
671 if (EVT::operator==(VT)) return true;
672 return getSizeInBits() >= VT.getSizeInBits();
675 /// bitsLT - Return true if this has less bits than VT.
676 bool bitsLT(EVT VT) const {
677 if (EVT::operator==(VT)) return false;
678 return getSizeInBits() < VT.getSizeInBits();
681 /// bitsLE - Return true if this has no more bits than VT.
682 bool bitsLE(EVT VT) const {
683 if (EVT::operator==(VT)) return true;
684 return getSizeInBits() <= VT.getSizeInBits();
688 /// getSimpleVT - Return the SimpleValueType held in the specified
690 MVT getSimpleVT() const {
691 assert(isSimple() && "Expected a SimpleValueType!");
695 /// getScalarType - If this is a vector type, return the element type,
696 /// otherwise return this.
697 EVT getScalarType() const {
698 return isVector() ? getVectorElementType() : *this;
701 /// getVectorElementType - Given a vector type, return the type of
703 EVT getVectorElementType() const {
704 assert(isVector() && "Invalid vector type!");
706 return V.getVectorElementType();
707 return getExtendedVectorElementType();
710 /// getVectorNumElements - Given a vector type, return the number of
711 /// elements it contains.
712 unsigned getVectorNumElements() const {
713 assert(isVector() && "Invalid vector type!");
715 return V.getVectorNumElements();
716 return getExtendedVectorNumElements();
719 /// getSizeInBits - Return the size of the specified value type in bits.
720 unsigned getSizeInBits() const {
722 return V.getSizeInBits();
723 return getExtendedSizeInBits();
726 /// getStoreSize - Return the number of bytes overwritten by a store
727 /// of the specified value type.
728 unsigned getStoreSize() const {
729 return (getSizeInBits() + 7) / 8;
732 /// getStoreSizeInBits - Return the number of bits overwritten by a store
733 /// of the specified value type.
734 unsigned getStoreSizeInBits() const {
735 return getStoreSize() * 8;
738 /// getRoundIntegerType - Rounds the bit-width of the given integer EVT up
739 /// to the nearest power of two (and at least to eight), and returns the
740 /// integer EVT with that number of bits.
741 EVT getRoundIntegerType(LLVMContext &Context) const {
742 assert(isInteger() && !isVector() && "Invalid integer type!");
743 unsigned BitWidth = getSizeInBits();
746 return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
749 /// getHalfSizedIntegerVT - Finds the smallest simple value type that is
750 /// greater than or equal to half the width of this EVT. If no simple
751 /// value type can be found, an extended integer value type of half the
752 /// size (rounded up) is returned.
753 EVT getHalfSizedIntegerVT(LLVMContext &Context) const {
754 assert(isInteger() && !isVector() && "Invalid integer type!");
755 unsigned EVTSize = getSizeInBits();
756 for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
757 IntVT <= MVT::LAST_INTEGER_VALUETYPE; ++IntVT) {
758 EVT HalfVT = EVT((MVT::SimpleValueType)IntVT);
759 if (HalfVT.getSizeInBits() * 2 >= EVTSize)
762 return getIntegerVT(Context, (EVTSize + 1) / 2);
765 /// isPow2VectorType - Returns true if the given vector is a power of 2.
766 bool isPow2VectorType() const {
767 unsigned NElts = getVectorNumElements();
768 return !(NElts & (NElts - 1));
771 /// getPow2VectorType - Widens the length of the given vector EVT up to
772 /// the nearest power of 2 and returns that type.
773 EVT getPow2VectorType(LLVMContext &Context) const {
774 if (!isPow2VectorType()) {
775 unsigned NElts = getVectorNumElements();
776 unsigned Pow2NElts = 1 << Log2_32_Ceil(NElts);
777 return EVT::getVectorVT(Context, getVectorElementType(), Pow2NElts);
784 /// getEVTString - This function returns value type as a string,
786 std::string getEVTString() const;
788 /// getTypeForEVT - This method returns an LLVM type corresponding to the
789 /// specified EVT. For integer types, this returns an unsigned type. Note
790 /// that this will abort for types that cannot be represented.
791 Type *getTypeForEVT(LLVMContext &Context) const;
793 /// getEVT - Return the value type corresponding to the specified type.
794 /// This returns all pointers as iPTR. If HandleUnknown is true, unknown
795 /// types are returned as Other, otherwise they are invalid.
796 static EVT getEVT(Type *Ty, bool HandleUnknown = false);
798 intptr_t getRawBits() {
802 return (intptr_t)(LLVMTy);
805 /// compareRawBits - A meaningless but well-behaved order, useful for
806 /// constructing containers.
807 struct compareRawBits {
808 bool operator()(EVT L, EVT R) const {
809 if (L.V.SimpleTy == R.V.SimpleTy)
810 return L.LLVMTy < R.LLVMTy;
812 return L.V.SimpleTy < R.V.SimpleTy;
817 // Methods for handling the Extended-type case in functions above.
818 // These are all out-of-line to prevent users of this header file
819 // from having a dependency on Type.h.
820 EVT changeExtendedVectorElementTypeToInteger() const;
821 static EVT getExtendedIntegerVT(LLVMContext &C, unsigned BitWidth);
822 static EVT getExtendedVectorVT(LLVMContext &C, EVT VT,
823 unsigned NumElements);
824 bool isExtendedFloatingPoint() const;
825 bool isExtendedInteger() const;
826 bool isExtendedVector() const;
827 bool isExtended16BitVector() const;
828 bool isExtended32BitVector() const;
829 bool isExtended64BitVector() const;
830 bool isExtended128BitVector() const;
831 bool isExtended256BitVector() const;
832 bool isExtended512BitVector() const;
833 bool isExtended1024BitVector() const;
834 EVT getExtendedVectorElementType() const;
835 unsigned getExtendedVectorNumElements() const;
836 unsigned getExtendedSizeInBits() const;
839 } // End llvm namespace