1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

[fast-isel] Don't try to encode LONG_MIN using cmn instructions.

rdar://11038907

llvm-svn: 152847
This commit is contained in:
Chad Rosier 2012-03-15 21:40:23 +00:00
parent 3812c82b92
commit 103b276e74

View File

@ -1384,12 +1384,16 @@ bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
SrcVT == MVT::i1) {
const APInt &CIVal = ConstInt->getValue();
Imm = (isZExt) ? (int)CIVal.getZExtValue() : (int)CIVal.getSExtValue();
if (Imm < 0) {
isNegativeImm = true;
Imm = -Imm;
// We can't encode LONG_MIN (i.e., 0x80000000) as an immediate because
// there is no way to represent 2147483648 as a signed 32-bit int.
if (Imm != (int)0x80000000) {
if (Imm < 0) {
isNegativeImm = true;
Imm = -Imm;
}
UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) :
(ARM_AM::getSOImmVal(Imm) != -1);
}
UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) :
(ARM_AM::getSOImmVal(Imm) != -1);
}
} else if (const ConstantFP *ConstFP = dyn_cast<ConstantFP>(Src2Value)) {
if (SrcVT == MVT::f32 || SrcVT == MVT::f64)