mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-17 10:48:09 +00:00
minor long double related changes
llvm-svn: 42439
This commit is contained in:
parent
cf40e00d32
commit
a30678c8f0
@ -1271,6 +1271,7 @@ void AsmPrinter::printDataDirective(const Type *type) {
|
||||
}
|
||||
break;
|
||||
case Type::FloatTyID: case Type::DoubleTyID:
|
||||
case Type::X86_FP80TyID: case Type::FP128TyID: case Type::PPC_FP128TyID:
|
||||
assert (0 && "Should have already output floating point constant.");
|
||||
default:
|
||||
assert (0 && "Can't handle printing this type of thing");
|
||||
|
@ -794,6 +794,24 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
Type::DoubleTy, sqrtFCache);
|
||||
break;
|
||||
}
|
||||
case Intrinsic::sqrt_f80: {
|
||||
static Constant *sqrtF80Cache = 0;
|
||||
ReplaceCallWith("sqrtl", CI, CI->op_begin()+1, CI->op_end(),
|
||||
Type::X86_FP80Ty, sqrtF80Cache);
|
||||
break;
|
||||
}
|
||||
case Intrinsic::sqrt_f128: {
|
||||
static Constant *sqrtF128Cache = 0;
|
||||
ReplaceCallWith("sqrtl", CI, CI->op_begin()+1, CI->op_end(),
|
||||
Type::FP128Ty, sqrtF128Cache);
|
||||
break;
|
||||
}
|
||||
case Intrinsic::sqrt_ppcf128: {
|
||||
static Constant *sqrtppcF128Cache = 0;
|
||||
ReplaceCallWith("sqrtl", CI, CI->op_begin()+1, CI->op_end(),
|
||||
Type::PPC_FP128Ty, sqrtppcF128Cache);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(CI->use_empty() &&
|
||||
|
@ -1115,17 +1115,15 @@ public:
|
||||
/// @brief Perform the pow optimization.
|
||||
virtual bool OptimizeCall(CallInst *ci, SimplifyLibCalls &SLC) {
|
||||
const Type *Ty = cast<Function>(ci->getOperand(0))->getReturnType();
|
||||
if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
|
||||
return false; // FIXME long double not yet supported
|
||||
Value* base = ci->getOperand(1);
|
||||
Value* expn = ci->getOperand(2);
|
||||
if (ConstantFP *Op1 = dyn_cast<ConstantFP>(base)) {
|
||||
if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
|
||||
return false; // FIXME long double not yet supported
|
||||
if (Op1->isExactlyValue(1.0)) // pow(1.0,x) -> 1.0
|
||||
return ReplaceCallWith(ci, ConstantFP::get(Ty,
|
||||
Ty==Type::FloatTy ? APFloat(1.0f) : APFloat(1.0)));
|
||||
} else if (ConstantFP* Op2 = dyn_cast<ConstantFP>(expn)) {
|
||||
if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
|
||||
return false; // FIXME long double not yet supported
|
||||
if (Op2->getValueAPF().isZero()) {
|
||||
// pow(x,0.0) -> 1.0
|
||||
return ReplaceCallWith(ci, ConstantFP::get(Ty,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the flex scanner for LLVM 1.9 assembly languages files.
|
||||
// This doesn't handle long double constants, since LLVM 1.9 did not have them.
|
||||
//
|
||||
//===----------------------------------------------------------------------===*/
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the flex scanner for LLVM 1.9 assembly languages files.
|
||||
// This doesn't handle long double constants, since LLVM 1.9 did not have them.
|
||||
//
|
||||
//===----------------------------------------------------------------------===*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user