mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Add a getNumSignBits() method to APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2088,12 +2088,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const{
|
||||
|
||||
case ISD::Constant: {
|
||||
const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
|
||||
// If negative, return # leading ones.
|
||||
if (Val.isNegative())
|
||||
return Val.countLeadingOnes();
|
||||
|
||||
// Return # leading zeros.
|
||||
return Val.countLeadingZeros();
|
||||
return Val.getNumSignBits();
|
||||
}
|
||||
|
||||
case ISD::SIGN_EXTEND:
|
||||
|
Reference in New Issue
Block a user