diff options
author | Duncan Sands <baldrick@free.fr> | 2008-10-29 14:22:20 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-10-29 14:22:20 +0000 |
commit | d22ec5f62813f8cf2ed8091f44a14377209b1a59 (patch) | |
tree | e44982efd9dd16a78c8200883d8e35e6b6164e68 /include/llvm/CodeGen/ValueTypes.h | |
parent | 54898938673d2a13ce31626ec34b2d4d314b2c81 (diff) |
Add sanity checking for BUILD_PAIR (I noticed the
other day that PPC custom lowering could create
a BUILD_PAIR of two f64 with a result type of...
f64! - already fixed). Fix a place that triggers
the sanity check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/ValueTypes.h')
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index f1b489ee3b..c4bcaf174a 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -142,6 +142,24 @@ namespace llvm { inline bool operator== (const MVT VT) const { return V == VT.V; } inline bool operator!= (const MVT VT) const { return V != VT.V; } + /// getFloatingPointVT - Returns the MVT that represents a floating point + /// type with the given number of bits. There are two floating point types + /// with 128 bits - this returns f128 rather than ppcf128. + static inline MVT getFloatingPointVT(unsigned BitWidth) { + switch (BitWidth) { + default: + assert(false && "Bad bit width!"); + case 32: + return f32; + case 64: + return f64; + case 80: + return f80; + case 128: + return f128; + } + } + /// getIntegerVT - Returns the MVT that represents an integer with the given /// number of bits. static inline MVT getIntegerVT(unsigned BitWidth) { |