llvm.org GIT mirror llvm / 79653fc
Just use APFloat for const / const. Fixes -1. / -0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42254 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 13 years ago
1 changed file(s) with 0 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
698698 (void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven);
699699 return ConstantFP::get(CFP1->getType(), C3V);
700700 case Instruction::FDiv:
701 // FIXME better to look at the return code
702 if (C2V.isZero())
703 if (C1V.isZero())
704 // IEEE 754, Section 7.1, #4
705 return ConstantFP::get(CFP1->getType(), isDouble ?
706 APFloat(std::numeric_limits::quiet_NaN()) :
707 APFloat(std::numeric_limits::quiet_NaN()));
708 else if (C2V.isNegZero() || C1V.isNegative())
709 // IEEE 754, Section 7.2, negative infinity case
710 return ConstantFP::get(CFP1->getType(), isDouble ?
711 APFloat(-std::numeric_limits::infinity()) :
712 APFloat(-std::numeric_limits::infinity()));
713 else
714 // IEEE 754, Section 7.2, positive infinity case
715 return ConstantFP::get(CFP1->getType(), isDouble ?
716 APFloat(std::numeric_limits::infinity()) :
717 APFloat(std::numeric_limits::infinity()));
718701 (void)C3V.divide(C2V, APFloat::rmNearestTiesToEven);
719702 return ConstantFP::get(CFP1->getType(), C3V);
720703 case Instruction::FRem: