mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Handle -0.0 correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c50bbc9613
commit
d25e3ecb3c
@ -313,7 +313,10 @@ ConstantExpr::ConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
|
||||
/// specify the full Instruction::OPCODE identifier.
|
||||
///
|
||||
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) {
|
||||
assert(isa<ConstantIntegral>(C) && "Cannot NOT a nonintegral type!");
|
||||
|
Loading…
Reference in New Issue
Block a user