There is no portable std::abs overload for int64_t, use the llvm::abs64

which exists for this purpose.

llvm-svn: 154199
This commit is contained in:
Chandler Carruth 2012-04-06 20:10:52 +00:00
parent 481d5abf45
commit 8a102c21e3
1 changed files with 2 additions and 2 deletions

View File

@ -8616,9 +8616,9 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
bool ARMTargetLowering::isLegalICmpImmediate(int64_t Imm) const {
// Thumb2 and ARM modes can use cmn for negative immediates.
if (!Subtarget->isThumb())
return ARM_AM::getSOImmVal(std::abs(Imm)) != -1;
return ARM_AM::getSOImmVal(llvm::abs64(Imm)) != -1;
if (Subtarget->isThumb2())
return ARM_AM::getT2SOImmVal(std::abs(Imm)) != -1;
return ARM_AM::getT2SOImmVal(llvm::abs64(Imm)) != -1;
// Thumb1 doesn't have cmn, and only 8-bit immediates.
return Imm >= 0 && Imm <= 255;
}