mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 17:56:53 +00:00
Handle -0.0 correctly
llvm-svn: 12530
This commit is contained in:
parent
8b1b8ab325
commit
50dc89f874
@ -313,7 +313,10 @@ ConstantExpr::ConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
|
|||||||
/// specify the full Instruction::OPCODE identifier.
|
/// specify the full Instruction::OPCODE identifier.
|
||||||
///
|
///
|
||||||
Constant *ConstantExpr::getNeg(Constant *C) {
|
Constant *ConstantExpr::getNeg(Constant *C) {
|
||||||
return get(Instruction::Sub, getNullValue(C->getType()), C);
|
if (!C->getType()->isFloatingPoint())
|
||||||
|
return get(Instruction::Sub, getNullValue(C->getType()), C);
|
||||||
|
else
|
||||||
|
return get(Instruction::Sub, ConstantFP::get(C->getType(), -0.0), C);
|
||||||
}
|
}
|
||||||
Constant *ConstantExpr::getNot(Constant *C) {
|
Constant *ConstantExpr::getNot(Constant *C) {
|
||||||
assert(isa<ConstantIntegral>(C) && "Cannot NOT a nonintegral type!");
|
assert(isa<ConstantIntegral>(C) && "Cannot NOT a nonintegral type!");
|
||||||
|
Loading…
Reference in New Issue
Block a user