Skip to content

Commit bc8a6dd

Browse files
committed
Remove dead code
1 parent b1478c3 commit bc8a6dd

File tree

4 files changed

+0
-81
lines changed

4 files changed

+0
-81
lines changed

src/arm64/bitmanipulation.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *resu
5555
#endif
5656
}
5757

58-
#if 0 // Currently unused
59-
really_inline bool mul_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
60-
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
61-
*result = value1 * value2;
62-
return !!__umulh(value1, value2);
63-
#else
64-
return __builtin_umulll_overflow(value1, value2, (unsigned long long *)result);
65-
#endif
66-
}
67-
#endif // Currently unused
68-
6958
} // namespace arm64
7059
} // namespace {
7160

src/fallback/bitmanipulation.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
5128
really_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

src/haswell/bitmanipulation.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2,
5353
#endif
5454
}
5555

56-
#if 0 // Currently unused
57-
#if defined(SIMDJSON_REGULAR_VISUAL_STUDIO) || defined(SIMDJSON_IS_32BITS)
58-
#pragma intrinsic(_umul128)
59-
#endif
60-
really_inline bool mul_overflow(uint64_t value1, uint64_t value2,
61-
uint64_t *result) {
62-
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
63-
uint64_t high;
64-
*result = _umul128(value1, value2, &high);
65-
return high;
66-
#else
67-
return __builtin_umulll_overflow(value1, value2,
68-
(unsigned long long *)result);
69-
#endif
70-
}
71-
#endif // Currently unused
72-
7356
} // namespace SIMDJSON_IMPLEMENTATION
7457
} // namespace {
7558

src/westmere/bitmanipulation.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2,
6262
#endif
6363
}
6464

65-
#if 0 // Currently unused
66-
#if defined(SIMDJSON_REGULAR_VISUAL_STUDIO) || defined(SIMDJSON_IS_32BITS)
67-
#pragma intrinsic(_umul128)
68-
#endif
69-
really_inline bool mul_overflow(uint64_t value1, uint64_t value2,
70-
uint64_t *result) {
71-
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
72-
uint64_t high;
73-
*result = _umul128(value1, value2, &high);
74-
return high;
75-
#else
76-
return __builtin_umulll_overflow(value1, value2,
77-
(unsigned long long *)result);
78-
#endif
79-
}
80-
#endif // Currently unused
81-
8265
} // namespace SIMDJSON_IMPLEMENTATION
8366
} // namespace {
8467

0 commit comments

Comments
 (0)