Skip to content

Commit

Permalink
Long double, part 1 of N. Support in IR.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Dale Johannesen committed Aug 3, 2007
1 parent 107f54a commit 320fc8a
Show file tree
Hide file tree
Showing 15 changed files with 3,751 additions and 4,516 deletions.
9 changes: 8 additions & 1 deletion include/llvm/Bitcode/LLVMBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ namespace bitc {
TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, paramty x N]
TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, eltty x N]
TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty]
TYPE_CODE_VECTOR = 12 // VECTOR: [numelts, eltty]
TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]

// These are not with the other floating point types because they're
// a late addition, and putting them in the right place breaks
// binary compatibility.
TYPE_CODE_X86_FP80 = 13, // X86 LONG DOUBLE
TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa)
TYPE_CODE_PPC_FP128= 15 // PPC LONG DOUBLE (2 doubles)
// Any other type code is assumed to be an unknown type.
};

Expand Down
25 changes: 15 additions & 10 deletions include/llvm/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,21 @@ class Type : public AbstractTypeUser {
VoidTyID = 0, ///< 0: type with no size
FloatTyID, ///< 1: 32 bit floating point type
DoubleTyID, ///< 2: 64 bit floating point type
LabelTyID, ///< 3: Labels
X86_FP80TyID, ///< 3: 80 bit floating point type (X87)
FP128TyID, ///< 4: 128 bit floating point type (112-bit mantissa)
PPC_FP128TyID, ///< 5: 128 bit floating point type (two 64-bits)
LabelTyID, ///< 6: Labels

// Derived types... see DerivedTypes.h file...
// Make sure FirstDerivedTyID stays up to date!!!
IntegerTyID, ///< 4: Arbitrary bit width integers
FunctionTyID, ///< 5: Functions
StructTyID, ///< 6: Structures
PackedStructTyID,///< 7: Packed Structure. This is for bitcode only
ArrayTyID, ///< 8: Arrays
PointerTyID, ///< 9: Pointers
OpaqueTyID, ///< 10: Opaque: type with unknown structure
VectorTyID, ///< 11: SIMD 'packed' format, or other vector type
IntegerTyID, ///< 7: Arbitrary bit width integers
FunctionTyID, ///< 8: Functions
StructTyID, ///< 9: Structures
PackedStructTyID,///< 10: Packed Structure. This is for bitcode only
ArrayTyID, ///< 11: Arrays
PointerTyID, ///< 12: Pointers
OpaqueTyID, ///< 13: Opaque: type with unknown structure
VectorTyID, ///< 14: SIMD 'packed' format, or other vector type

NumTypeIDs, // Must remain as last defined ID
LastPrimitiveTyID = LabelTyID,
Expand Down Expand Up @@ -179,7 +182,8 @@ class Type : public AbstractTypeUser {

/// isFloatingPoint - Return true if this is one of the two floating point
/// types
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; }
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }

/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
///
Expand Down Expand Up @@ -282,6 +286,7 @@ class Type : public AbstractTypeUser {
// These are the builtin types that are always available...
//
static const Type *VoidTy, *LabelTy, *FloatTy, *DoubleTy;
static const Type *X86_FP80Ty, *FP128Ty, *PPC_FP128Ty;
static const IntegerType *Int1Ty, *Int8Ty, *Int16Ty, *Int32Ty, *Int64Ty;

/// Methods for support type inquiry through isa, cast, and dyn_cast:
Expand Down
1,551 changes: 795 additions & 756 deletions lib/AsmParser/Lexer.cpp.cvs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/AsmParser/Lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
void { RET_TY(Type::VoidTy, VOID); }
float { RET_TY(Type::FloatTy, FLOAT); }
double { RET_TY(Type::DoubleTy,DOUBLE);}
x86_fp80 { RET_TY(Type::X86_FP80Ty, X86_FP80);}
fp128 { RET_TY(Type::FP128Ty, FP128);}
ppc_fp128 { RET_TY(Type::PPC_FP128Ty, PPC_FP128);}
label { RET_TY(Type::LabelTy, LABEL); }
type { return TYPE; }
opaque { return OPAQUE; }
Expand Down
3 changes: 3 additions & 0 deletions lib/AsmParser/Lexer.l.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
void { RET_TY(Type::VoidTy, VOID); }
float { RET_TY(Type::FloatTy, FLOAT); }
double { RET_TY(Type::DoubleTy,DOUBLE);}
x86_fp80 { RET_TY(Type::X86_FP80Ty, X86_FP80);}
fp128 { RET_TY(Type::FP128Ty, FP128);}
ppc_fp128 { RET_TY(Type::PPC_FP128Ty, PPC_FP128);}
label { RET_TY(Type::LabelTy, LABEL); }
type { return TYPE; }
opaque { return OPAQUE; }
Expand Down
Loading

0 comments on commit 320fc8a

Please sign in to comment.