Remove dead code

This commit is contained in:
John Keiser 2020-08-01 14:42:38 -07:00
parent b1478c37f6
commit bc8a6dd2e3
4 changed files with 0 additions and 81 deletions

View File

@ -55,17 +55,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *resu
#endif
}
#if 0 // Currently unused
really_inline bool mul_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
*result = value1 * value2;
return !!__umulh(value1, value2);
#else
return __builtin_umulll_overflow(value1, value2, (unsigned long long *)result);
#endif
}
#endif // Currently unused
} // namespace arm64
} // namespace {

View File

@ -24,29 +24,6 @@ static unsigned char _BitScanReverse64(unsigned long* ret, uint64_t x) {
}
#endif
//
// These are currently unused, but one day will be.
//
#if 0 // Currently unused
NO_SANITIZE_UNDEFINED
really_inline int trailing_zeroes(uint64_t input_num) {
#ifdef _MSC_VER
unsigned long ret;
// Search the mask data from least significant bit (LSB)
// to the most significant bit (MSB) for a set bit (1).
_BitScanForward64(&ret, input_num);
return (int)ret;
#else // _MSC_VER
return __builtin_ctzll(input_num);
#endif // _MSC_VER
}
/* result might be undefined when input_num is zero */
really_inline uint64_t clear_lowest_bit(uint64_t input_num) {
return input_num & (input_num-1);
}
#endif // Currently unused
/* result might be undefined when input_num is zero */
really_inline int leading_zeroes(uint64_t input_num) {
#ifdef _MSC_VER
@ -62,19 +39,6 @@ really_inline int leading_zeroes(uint64_t input_num) {
#endif// _MSC_VER
}
#if 0 // Currently unused
really_inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
*result = value1 + value2;
return *result < value1;
}
really_inline bool mul_overflow(uint64_t value1, uint64_t value2, uint64_t *result) {
*result = value1 * value2;
// TODO there must be a faster way
return value2 > 0 && value1 > std::numeric_limits<uint64_t>::max() / value2;
}
#endif // Currently unused
} // namespace fallback
} // namespace {

View File

@ -53,23 +53,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2,
#endif
}
#if 0 // Currently unused
#if defined(SIMDJSON_REGULAR_VISUAL_STUDIO) || defined(SIMDJSON_IS_32BITS)
#pragma intrinsic(_umul128)
#endif
really_inline bool mul_overflow(uint64_t value1, uint64_t value2,
uint64_t *result) {
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
uint64_t high;
*result = _umul128(value1, value2, &high);
return high;
#else
return __builtin_umulll_overflow(value1, value2,
(unsigned long long *)result);
#endif
}
#endif // Currently unused
} // namespace SIMDJSON_IMPLEMENTATION
} // namespace {

View File

@ -62,23 +62,6 @@ really_inline bool add_overflow(uint64_t value1, uint64_t value2,
#endif
}
#if 0 // Currently unused
#if defined(SIMDJSON_REGULAR_VISUAL_STUDIO) || defined(SIMDJSON_IS_32BITS)
#pragma intrinsic(_umul128)
#endif
really_inline bool mul_overflow(uint64_t value1, uint64_t value2,
uint64_t *result) {
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
uint64_t high;
*result = _umul128(value1, value2, &high);
return high;
#else
return __builtin_umulll_overflow(value1, value2,
(unsigned long long *)result);
#endif
}
#endif // Currently unused
} // namespace SIMDJSON_IMPLEMENTATION
} // namespace {