mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-24 08:33:39 +00:00
Add an assert so we don't silently miscompile ctpop for bit widths > 128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123549 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
28f0ed5c9d
commit
5df5a22d1a
@ -2389,6 +2389,7 @@ SDValue SelectionDAGLegalize::ExpandBSWAP(SDValue Op, DebugLoc dl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// SplatByte - Distribute ByteVal over NumBits bits.
|
/// SplatByte - Distribute ByteVal over NumBits bits.
|
||||||
|
// FIXME: Move this helper to a common place.
|
||||||
static APInt SplatByte(unsigned NumBits, uint8_t ByteVal) {
|
static APInt SplatByte(unsigned NumBits, uint8_t ByteVal) {
|
||||||
APInt Val = APInt(NumBits, ByteVal);
|
APInt Val = APInt(NumBits, ByteVal);
|
||||||
unsigned Shift = 8;
|
unsigned Shift = 8;
|
||||||
@ -2410,6 +2411,9 @@ SDValue SelectionDAGLegalize::ExpandBitCount(unsigned Opc, SDValue Op,
|
|||||||
EVT ShVT = TLI.getShiftAmountTy();
|
EVT ShVT = TLI.getShiftAmountTy();
|
||||||
unsigned Len = VT.getSizeInBits();
|
unsigned Len = VT.getSizeInBits();
|
||||||
|
|
||||||
|
assert(VT.isInteger() && Len <= 128 && Len % 8 == 0 &&
|
||||||
|
"CTPOP not implemented for this type.");
|
||||||
|
|
||||||
// This is the "best" algorithm from
|
// This is the "best" algorithm from
|
||||||
// http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
|
// http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user