Lines Matching full:countleadingzeros
37 TEST(MathExtras, countLeadingZeros) {
42 EXPECT_EQ(8u, countLeadingZeros(Z8));
43 EXPECT_EQ(16u, countLeadingZeros(Z16));
44 EXPECT_EQ(32u, countLeadingZeros(Z32));
45 EXPECT_EQ(64u, countLeadingZeros(Z64));
51 EXPECT_EQ(2u, countLeadingZeros(NZ8));
52 EXPECT_EQ(10u, countLeadingZeros(NZ16));
53 EXPECT_EQ(26u, countLeadingZeros(NZ32));
54 EXPECT_EQ(58u, countLeadingZeros(NZ64));
56 EXPECT_EQ(8u, countLeadingZeros(0x00F000FFu));
57 EXPECT_EQ(8u, countLeadingZeros(0x00F12345u));
59 EXPECT_EQ(31 - i, countLeadingZeros(1u << i));
62 EXPECT_EQ(8u, countLeadingZeros(0x00F1234500F12345ULL));
63 EXPECT_EQ(1u, countLeadingZeros(1ULL << 62));
65 EXPECT_EQ(63 - i, countLeadingZeros(1ULL << i));