diff options
author | Kit Barton <kbarton@ca.ibm.com> | 2015-04-17 15:32:15 +0000 |
---|---|---|
committer | Kit Barton <kbarton@ca.ibm.com> | 2015-04-17 15:32:15 +0000 |
commit | 72918025332a942ddaf64c0afb2d5867b95197a4 (patch) | |
tree | 5adfed59d918a3db8d691f49d00733154d432156 /llvm/lib | |
parent | d854180afb5534537d854504498d96803dd914fe (diff) | |
download | bcm5719-llvm-72918025332a942ddaf64c0afb2d5867b95197a4.tar.gz bcm5719-llvm-72918025332a942ddaf64c0afb2d5867b95197a4.zip |
Add the i128 builtin type to LLVM.
The i128 type is needed as a builtin type in order to support the v1i128 vector
type. The PowerPC ABI requires that the i128 and v1i128 types are handled
differently when passed as parameters to functions (i128 is passed in pairs of
GPRs, v1i128 is passed in a single vector register).
http://reviews.llvm.org/D8564
llvm-svn: 235196
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 2 | ||||
-rw-r--r-- | llvm/lib/IR/Type.cpp | 1 |
4 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 7fe7beb40c6..0c1023c7348 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -310,6 +310,9 @@ LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C) { LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C) { return (LLVMTypeRef) Type::getInt64Ty(*unwrap(C)); } +LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C) { + return (LLVMTypeRef) Type::getInt128Ty(*unwrap(C)); +} LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits) { return wrap(IntegerType::get(*unwrap(C), NumBits)); } @@ -329,6 +332,9 @@ LLVMTypeRef LLVMInt32Type(void) { LLVMTypeRef LLVMInt64Type(void) { return LLVMInt64TypeInContext(LLVMGetGlobalContext()); } +LLVMTypeRef LLVMInt128Type(void) { + return LLVMInt128TypeInContext(LLVMGetGlobalContext()); +} LLVMTypeRef LLVMIntType(unsigned NumBits) { return LLVMIntTypeInContext(LLVMGetGlobalContext(), NumBits); } diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp index d717b92d9fe..1e2080770fc 100644 --- a/llvm/lib/IR/LLVMContextImpl.cpp +++ b/llvm/lib/IR/LLVMContextImpl.cpp @@ -35,7 +35,8 @@ LLVMContextImpl::LLVMContextImpl(LLVMContext &C) Int8Ty(C, 8), Int16Ty(C, 16), Int32Ty(C, 32), - Int64Ty(C, 64) { + Int64Ty(C, 64), + Int128Ty(C, 128) { InlineAsmDiagHandler = nullptr; InlineAsmDiagContext = nullptr; DiagnosticHandler = nullptr; diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index c096a831b20..4eb37fd14be 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -920,7 +920,7 @@ public: // Basic type instances. Type VoidTy, LabelTy, HalfTy, FloatTy, DoubleTy, MetadataTy; Type X86_FP80Ty, FP128Ty, PPC_FP128Ty, X86_MMXTy; - IntegerType Int1Ty, Int8Ty, Int16Ty, Int32Ty, Int64Ty; + IntegerType Int1Ty, Int8Ty, Int16Ty, Int32Ty, Int64Ty, Int128Ty; /// TypeAllocator - All dynamically allocated types are allocated from this. diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp index 65060dc39d2..d8baf7c9d33 100644 --- a/llvm/lib/IR/Type.cpp +++ b/llvm/lib/IR/Type.cpp @@ -238,6 +238,7 @@ IntegerType *Type::getInt8Ty(LLVMContext &C) { return &C.pImpl->Int8Ty; } IntegerType *Type::getInt16Ty(LLVMContext &C) { return &C.pImpl->Int16Ty; } IntegerType *Type::getInt32Ty(LLVMContext &C) { return &C.pImpl->Int32Ty; } IntegerType *Type::getInt64Ty(LLVMContext &C) { return &C.pImpl->Int64Ty; } +IntegerType *Type::getInt128Ty(LLVMContext &C) { return &C.pImpl->Int128Ty; } IntegerType *Type::getIntNTy(LLVMContext &C, unsigned N) { return IntegerType::get(C, N); |