summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-12-20 00:02:33 +0000
committerDan Gohman <gohman@apple.com>2011-12-20 00:02:33 +0000
commit94580ab37559dd409194d5003b743f844ec5f00a (patch)
treea75b409120e9c07182517cedde550094476c8941 /llvm/lib/Target/TargetData.cpp
parentbd26cf90dc86b32fab7fc01e2a2df04bed93cec3 (diff)
downloadbcm5719-llvm-94580ab37559dd409194d5003b743f844ec5f00a.tar.gz
bcm5719-llvm-94580ab37559dd409194d5003b743f844ec5f00a.zip
Add basic generic CodeGen support for half.
llvm-svn: 146927
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
-rw-r--r--llvm/lib/Target/TargetData.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index ff60e0b29c7..2b39f1308b7 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -147,6 +147,7 @@ void TargetData::init() {
setAlignment(INTEGER_ALIGN, 2, 2, 16); // i16
setAlignment(INTEGER_ALIGN, 4, 4, 32); // i32
setAlignment(INTEGER_ALIGN, 4, 8, 64); // i64
+ setAlignment(FLOAT_ALIGN, 2, 2, 16); // half
setAlignment(FLOAT_ALIGN, 4, 4, 32); // float
setAlignment(FLOAT_ALIGN, 8, 8, 64); // double
setAlignment(VECTOR_ALIGN, 8, 8, 64); // v2i32, v1i64, ...
@@ -477,6 +478,8 @@ uint64_t TargetData::getTypeSizeInBits(Type *Ty) const {
return cast<IntegerType>(Ty)->getBitWidth();
case Type::VoidTyID:
return 8;
+ case Type::HalfTyID:
+ return 16;
case Type::FloatTyID:
return 32;
case Type::DoubleTyID:
@@ -534,6 +537,7 @@ unsigned TargetData::getAlignment(Type *Ty, bool abi_or_pref) const {
case Type::VoidTyID:
AlignType = INTEGER_ALIGN;
break;
+ case Type::HalfTyID:
case Type::FloatTyID:
case Type::DoubleTyID:
// PPC_FP128TyID and FP128TyID have different data contents, but the
OpenPOWER on IntegriCloud