mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO
v2: tighten the sub64 tests
v3: rename to CARRY/BORROW
v4: fixup test cmdline
add known bits computation
use sign extend instead of sub 0,x
better add test
v5: remove redundant break
move lowering to separate functions
fix comments
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: arsenm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2763,6 +2763,12 @@ void AMDGPUTargetLowering::computeKnownBitsForTargetNode(
|
||||
KnownZero, KnownOne, DAG, Depth);
|
||||
break;
|
||||
|
||||
case AMDGPUISD::CARRY:
|
||||
case AMDGPUISD::BORROW: {
|
||||
KnownZero = APInt::getHighBitsSet(32, 31);
|
||||
break;
|
||||
}
|
||||
|
||||
case AMDGPUISD::BFE_I32:
|
||||
case AMDGPUISD::BFE_U32: {
|
||||
ConstantSDNode *CWidth = dyn_cast<ConstantSDNode>(Op.getOperand(2));
|
||||
@@ -2805,6 +2811,10 @@ unsigned AMDGPUTargetLowering::ComputeNumSignBitsForTargetNode(
|
||||
return Width ? 32 - (Width->getZExtValue() & 0x1f) : 1;
|
||||
}
|
||||
|
||||
case AMDGPUISD::CARRY:
|
||||
case AMDGPUISD::BORROW:
|
||||
return 31;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user