]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
shiftTooManyBitsSigned
authorgtsoul-tech <gtsoulkanakis@gmail.com>
Wed, 24 Apr 2024 08:13:28 +0000 (11:13 +0300)
committergtsoul-tech <gtsoulkanakis@gmail.com>
Wed, 24 Apr 2024 08:13:28 +0000 (11:13 +0300)
unit/internal/bitutils.cpp
unit/internal/supervector.cpp

index 8af8f9a434d14e7c007d80e6aa4a9723b3927e85..6adfc2d6e96b42003f34d1e567b6b103c2dd4eed 100644 (file)
@@ -62,7 +62,7 @@ u32 our_clzll(u64a x) {
 TEST(BitUtils, findAndClearLSB32_1) {
     // test that it can find every single-bit case
     for (unsigned int i = 0; i < 32; i++) {
-        u32 input = 1 << i;
+        u32 input = 1U << i;
         u32 idx = findAndClearLSB_32(&input);
         EXPECT_EQ(i, idx);
         EXPECT_EQ(0U, input);
@@ -112,7 +112,7 @@ TEST(BitUtils, findAndClearLSB64_2) {
 TEST(BitUtils, findAndClearMSB32_1) {
     // test that it can find every single-bit case
     for (unsigned int i = 0; i < 32; i++) {
-        u32 input = 1 << i;
+        u32 input = 1U << i;
         u32 idx = findAndClearMSB_32(&input);
         EXPECT_EQ(i, idx);
         EXPECT_EQ(0U, input);
index 2432e598b8607aac6f174436d3d49de8bc49550a..ac3daf2a8ca946b91b070be8bb3aa608e7ebd1f5 100644 (file)
@@ -508,7 +508,7 @@ TEST(SuperVectorUtilsTest,Movemask256c){
     u8 vec2[32] = {0};
     u32 r = rand() % 100 + 1;
     for(int i=0; i<32; i++) {
-        if (r & (1 << i)) {
+        if (r & (1U << i)) {
             vec[i] = 0xff;
         }
     }