@@ -24,29 +24,6 @@ static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) {
2424}
2525#endif
2626
27- //
28- // These are currently unused, but one day will be.
29- //
30- #if 0 // Currently unused
31- NO_SANITIZE_UNDEFINED
32- really_inline int trailing_zeroes(uint64_t input_num) {
33- #ifdef _MSC_VER
34- unsigned long ret;
35- // Search the mask data from least significant bit (LSB)
36- // to the most significant bit (MSB) for a set bit (1).
37- _BitScanForward64(&ret, input_num);
38- return (int)ret;
39- #else // _MSC_VER
40- return __builtin_ctzll(input_num);
41- #endif // _MSC_VER
42- }
43-
44- /* result might be undefined when input_num is zero */
45- really_inline uint64_t clear_lowest_bit(uint64_t input_num) {
46- return input_num & (input_num-1);
47- }
48- #endif // Currently unused
49-
5027/* result might be undefined when input_num is zero */
5128really_inline int leading_zeroes (uint64_t input_num) {
5229#ifdef _MSC_VER
@@ -62,19 +39,6 @@ really_inline int leading_zeroes(uint64_t input_num) {
6239#endif // _MSC_VER
6340}
6441
65- #if 0 // Currently unused
66- really_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
67- *result = value1 + value2;
68- return *result < value1;
69- }
70-
71- really_inline bool mul_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
72- *result = value1 * value2;
73- // TODO there must be a faster way
74- return value2 > 0 && value1 > std::numeric_limits<uint64_t>::max() / value2;
75- }
76- #endif // Currently unused
77-
7842} // namespace fallback
7943} // namespace {
8044
0 commit comments