mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Add BitVector::anyCommon().
The existing operation (A & B).any() is very slow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -242,6 +242,34 @@ TEST(BitVectorTest, PortableBitMask) {
|
||||
A.clearBitsNotInMask(Mask1, 1);
|
||||
EXPECT_EQ(64-4u, A.count());
|
||||
}
|
||||
}
|
||||
|
||||
TEST(BitVectorTest, BinOps) {
|
||||
BitVector A;
|
||||
BitVector B;
|
||||
|
||||
A.resize(65);
|
||||
EXPECT_FALSE(A.anyCommon(B));
|
||||
EXPECT_FALSE(B.anyCommon(B));
|
||||
|
||||
B.resize(64);
|
||||
A.set(64);
|
||||
EXPECT_FALSE(A.anyCommon(B));
|
||||
EXPECT_FALSE(B.anyCommon(A));
|
||||
|
||||
B.set(63);
|
||||
EXPECT_FALSE(A.anyCommon(B));
|
||||
EXPECT_FALSE(B.anyCommon(A));
|
||||
|
||||
A.set(63);
|
||||
EXPECT_TRUE(A.anyCommon(B));
|
||||
EXPECT_TRUE(B.anyCommon(A));
|
||||
|
||||
B.resize(70);
|
||||
B.set(64);
|
||||
B.reset(63);
|
||||
A.resize(64);
|
||||
EXPECT_FALSE(A.anyCommon(B));
|
||||
EXPECT_FALSE(B.anyCommon(A));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user