Fix CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll and PR1219

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34551 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-02-24 02:09:29 +00:00
parent 8c0261b590
commit 01ca65b23e

View File

@ -1459,11 +1459,11 @@ TargetLowering::SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1,
case ISD::SETGT:
case ISD::SETGE:
// True if the sign bit of C1 is set.
return DAG.getConstant((C1 & (1ULL << VSize)) != 0, VT);
return DAG.getConstant((C1 & (1ULL << (VSize-1))) != 0, VT);
case ISD::SETLT:
case ISD::SETLE:
// True if the sign bit of C1 isn't set.
return DAG.getConstant((C1 & (1ULL << VSize)) == 0, VT);
return DAG.getConstant((C1 & (1ULL << (VSize-1))) == 0, VT);
default:
break;
}