mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Don't hard-code the mask size to be 32, which is incorrect on ppc64
and was causing aborts with the new APInt changes. This may also be fixing an obscure ppc64 bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47692 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -741,16 +741,18 @@ bool PPCTargetLowering::SelectAddressRegReg(SDOperand N, SDOperand &Base,
|
||||
APInt LHSKnownZero, LHSKnownOne;
|
||||
APInt RHSKnownZero, RHSKnownOne;
|
||||
DAG.ComputeMaskedBits(N.getOperand(0),
|
||||
APInt::getAllOnesValue(32),
|
||||
APInt::getAllOnesValue(N.getOperand(0)
|
||||
.getValueSizeInBits()),
|
||||
LHSKnownZero, LHSKnownOne);
|
||||
|
||||
if (LHSKnownZero.getBoolValue()) {
|
||||
DAG.ComputeMaskedBits(N.getOperand(1),
|
||||
APInt::getAllOnesValue(32),
|
||||
APInt::getAllOnesValue(N.getOperand(1)
|
||||
.getValueSizeInBits()),
|
||||
RHSKnownZero, RHSKnownOne);
|
||||
// If all of the bits are known zero on the LHS or RHS, the add won't
|
||||
// carry.
|
||||
if ((LHSKnownZero | RHSKnownZero) == ~0U) {
|
||||
if (~(LHSKnownZero | RHSKnownZero) == 0) {
|
||||
Base = N.getOperand(0);
|
||||
Index = N.getOperand(1);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user