aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-08-03 01:03:46 +0000
committerDale Johannesen <dalej@apple.com>2007-08-03 01:03:46 +0000
commit320fc8a39e17f5725f5711248e06bcb36f122687 (patch)
tree9c3020b8e874758d20de1ddb5cac4aeb635bb2c6 /lib/VMCore/Type.cpp
parent107f54a0026cfc455252c5a79b4860ace4bbbfc1 (diff)
downloadexternal_llvm-320fc8a39e17f5725f5711248e06bcb36f122687.zip
external_llvm-320fc8a39e17f5725f5711248e06bcb36f122687.tar.gz
external_llvm-320fc8a39e17f5725f5711248e06bcb36f122687.tar.bz2
Long double, part 1 of N. Support in IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 9b34dd8..3f8643e 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -105,10 +105,13 @@ void Type::destroy() const {
const Type *Type::getPrimitiveType(TypeID IDNumber) {
switch (IDNumber) {
- case VoidTyID : return VoidTy;
- case FloatTyID : return FloatTy;
- case DoubleTyID: return DoubleTy;
- case LabelTyID : return LabelTy;
+ case VoidTyID : return VoidTy;
+ case FloatTyID : return FloatTy;
+ case DoubleTyID : return DoubleTy;
+ case X86_FP80TyID : return X86_FP80Ty;
+ case FP128TyID : return FP128Ty;
+ case PPC_FP128TyID : return PPC_FP128Ty;
+ case LabelTyID : return LabelTy;
default:
return 0;
}
@@ -126,7 +129,10 @@ const Type *Type::getVAArgsPromotedType() const {
/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
///
bool Type::isFPOrFPVector() const {
- if (ID == Type::FloatTyID || ID == Type::DoubleTyID) return true;
+ if (ID == Type::FloatTyID || ID == Type::DoubleTyID ||
+ ID == Type::FP128TyID || ID == Type::X86_FP80TyID ||
+ ID == Type::PPC_FP128TyID)
+ return true;
if (ID != Type::VectorTyID) return false;
return cast<VectorType>(this)->getElementType()->isFloatingPoint();
@@ -162,6 +168,9 @@ unsigned Type::getPrimitiveSizeInBits() const {
switch (getTypeID()) {
case Type::FloatTyID: return 32;
case Type::DoubleTyID: return 64;
+ case Type::X86_FP80TyID: return 80;
+ case Type::FP128TyID: return 128;
+ case Type::PPC_FP128TyID: return 128;
case Type::IntegerTyID: return cast<IntegerType>(this)->getBitWidth();
case Type::VectorTyID: return cast<VectorType>(this)->getBitWidth();
default: return 0;
@@ -251,6 +260,11 @@ static std::string getTypeDescription(const Type *Ty,
case Type::VoidTyID: return (*ConcreteTypeDescriptions)[Ty] = "void";
case Type::FloatTyID: return (*ConcreteTypeDescriptions)[Ty] = "float";
case Type::DoubleTyID: return (*ConcreteTypeDescriptions)[Ty] = "double";
+ case Type::X86_FP80TyID:
+ return (*ConcreteTypeDescriptions)[Ty] = "x86_fp80";
+ case Type::FP128TyID: return (*ConcreteTypeDescriptions)[Ty] = "fp128";
+ case Type::PPC_FP128TyID:
+ return (*ConcreteTypeDescriptions)[Ty] = "ppc_fp128";
case Type::LabelTyID: return (*ConcreteTypeDescriptions)[Ty] = "label";
}
}
@@ -393,10 +407,13 @@ const Type *StructType::getTypeAtIndex(const Value *V) const {
// Primitive 'Type' data
//===----------------------------------------------------------------------===//
-const Type *Type::VoidTy = new Type(Type::VoidTyID);
-const Type *Type::FloatTy = new Type(Type::FloatTyID);
-const Type *Type::DoubleTy = new Type(Type::DoubleTyID);
-const Type *Type::LabelTy = new Type(Type::LabelTyID);
+const Type *Type::VoidTy = new Type(Type::VoidTyID);
+const Type *Type::FloatTy = new Type(Type::FloatTyID);
+const Type *Type::DoubleTy = new Type(Type::DoubleTyID);
+const Type *Type::X86_FP80Ty = new Type(Type::X86_FP80TyID);
+const Type *Type::FP128Ty = new Type(Type::FP128TyID);
+const Type *Type::PPC_FP128Ty = new Type(Type::PPC_FP128TyID);
+const Type *Type::LabelTy = new Type(Type::LabelTyID);
namespace {
struct BuiltinIntegerType : public IntegerType {