diff options
| author | Dale Johannesen <dalej@apple.com> | 2007-09-11 18:32:33 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2007-09-11 18:32:33 +0000 |
| commit | 245dceb06d5d4ef8a4edace1cfddf54cf0122a64 (patch) | |
| tree | 5eecd813137e3673308a5f0e3ba38adc6f6dede4 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | 32ef96186f13d5fa1ca9aad369f1198fbba6a56d (diff) | |
| download | bcm5719-llvm-245dceb06d5d4ef8a4edace1cfddf54cf0122a64.tar.gz bcm5719-llvm-245dceb06d5d4ef8a4edace1cfddf54cf0122a64.zip | |
Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and
double interfaces where appropriate.
First bits of x86 long double constants handling
(untested, probably does not work).
llvm-svn: 41858
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 6d3bcf7bb51..95450ac97fa 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3410,11 +3410,11 @@ SDOperand X86TargetLowering::LowerFABS(SDOperand Op, SelectionDAG &DAG) { const Type *OpNTy = MVT::getTypeForValueType(EltVT); std::vector<Constant*> CV; if (EltVT == MVT::f64) { - Constant *C = ConstantFP::get(OpNTy, APFloat(BitsToDouble(~(1ULL << 63)))); + Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(64, ~(1ULL << 63)))); CV.push_back(C); CV.push_back(C); } else { - Constant *C = ConstantFP::get(OpNTy, APFloat(BitsToFloat(~(1U << 31)))); + Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(32, ~(1U << 31)))); CV.push_back(C); CV.push_back(C); CV.push_back(C); @@ -3438,11 +3438,11 @@ SDOperand X86TargetLowering::LowerFNEG(SDOperand Op, SelectionDAG &DAG) { const Type *OpNTy = MVT::getTypeForValueType(EltVT); std::vector<Constant*> CV; if (EltVT == MVT::f64) { - Constant *C = ConstantFP::get(OpNTy, APFloat(BitsToDouble(1ULL << 63))); + Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(64, 1ULL << 63))); CV.push_back(C); CV.push_back(C); } else { - Constant *C = ConstantFP::get(OpNTy, APFloat(BitsToFloat(1U << 31))); + Constant *C = ConstantFP::get(OpNTy, APFloat(APInt(32, 1U << 31))); CV.push_back(C); CV.push_back(C); CV.push_back(C); @@ -3479,13 +3479,13 @@ SDOperand X86TargetLowering::LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) { // First get the sign bit of second operand. std::vector<Constant*> CV; if (SrcVT == MVT::f64) { - CV.push_back(ConstantFP::get(SrcTy, APFloat(BitsToDouble(1ULL << 63)))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 1ULL << 63)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 0)))); } else { - CV.push_back(ConstantFP::get(SrcTy, APFloat(BitsToFloat(1U << 31)))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 1U << 31)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); } Constant *C = ConstantVector::get(CV); SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4); @@ -3507,13 +3507,13 @@ SDOperand X86TargetLowering::LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) { // Clear first operand sign bit. CV.clear(); if (VT == MVT::f64) { - CV.push_back(ConstantFP::get(SrcTy, APFloat(BitsToDouble(~(1ULL << 63))))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, ~(1ULL << 63))))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(64, 0)))); } else { - CV.push_back(ConstantFP::get(SrcTy, APFloat(BitsToFloat(~(1U << 31))))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); - CV.push_back(ConstantFP::get(SrcTy, APFloat(0.0f))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, ~(1U << 31))))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); + CV.push_back(ConstantFP::get(SrcTy, APFloat(APInt(32, 0)))); } C = ConstantVector::get(CV); CPIdx = DAG.getConstantPool(C, getPointerTy(), 4); |

