diff options
author | Dale Johannesen <dalej@apple.com> | 2007-10-11 18:07:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-10-11 18:07:22 +0000 |
commit | a471c2ecda37cd1bae0d94e832f002caa7b63216 (patch) | |
tree | 5585aa5c69106bf208bebbc089dccd54bd09154b /lib/VMCore/Constants.cpp | |
parent | f9193de25bcd2c7de6c7d60ec5992f546907231a (diff) | |
download | external_llvm-a471c2ecda37cd1bae0d94e832f002caa7b63216.zip external_llvm-a471c2ecda37cd1bae0d94e832f002caa7b63216.tar.gz external_llvm-a471c2ecda37cd1bae0d94e832f002caa7b63216.tar.bz2 |
Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations. Make readers and
writers work. Split constants into 2 doubles in
Legalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r-- | lib/VMCore/Constants.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 7de823b..350a306 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -114,6 +114,7 @@ Constant *Constant::getNullValue(const Type *Ty) { case Type::X86_FP80TyID: return ConstantFP::get(Ty, APFloat(APInt(80, 2, zero))); case Type::FP128TyID: + return ConstantFP::get(Ty, APFloat(APInt(128, 2, zero), true)); case Type::PPC_FP128TyID: return ConstantFP::get(Ty, APFloat(APInt(128, 2, zero))); case Type::PointerTyID: @@ -256,6 +257,8 @@ ConstantFP::ConstantFP(const Type *Ty, const APFloat& V) assert(&V.getSemantics()==&APFloat::x87DoubleExtended); else if (Ty==Type::FP128Ty) assert(&V.getSemantics()==&APFloat::IEEEquad); + else if (Ty==Type::PPC_FP128Ty) + assert(&V.getSemantics()==&APFloat::PPCDoubleDouble); else assert(0); } @@ -320,6 +323,8 @@ ConstantFP *ConstantFP::get(const Type *Ty, const APFloat& V) { assert(&V.getSemantics()==&APFloat::x87DoubleExtended); else if (Ty==Type::FP128Ty) assert(&V.getSemantics()==&APFloat::IEEEquad); + else if (Ty==Type::PPC_FP128Ty) + assert(&V.getSemantics()==&APFloat::PPCDoubleDouble); else assert(0); @@ -747,6 +752,10 @@ bool ConstantFP::isValueValidForType(const Type *Ty, const APFloat& Val) { return &Val2.getSemantics() == &APFloat::IEEEsingle || &Val2.getSemantics() == &APFloat::IEEEdouble || &Val2.getSemantics() == &APFloat::IEEEquad; + case Type::PPC_FP128TyID: + return &Val2.getSemantics() == &APFloat::IEEEsingle || + &Val2.getSemantics() == &APFloat::IEEEdouble || + &Val2.getSemantics() == &APFloat::PPCDoubleDouble; } } |