Skip to content

Commit

Permalink
Revert "[libc] Refactor BigInt (#86137)"
Browse files Browse the repository at this point in the history
This reverts commit a2306b6.
  • Loading branch information
gchatelet committed Apr 4, 2024
1 parent 47e996d commit c874f0d
Show file tree
Hide file tree
Showing 13 changed files with 762 additions and 1,011 deletions.
1 change: 0 additions & 1 deletion libc/fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
add_custom_target(libc-fuzzer)

add_subdirectory(__support)
# TODO(#85680): Re-enable math fuzzing after headers are sorted out
# add_subdirectory(math)
add_subdirectory(stdlib)
Expand Down
7 changes: 0 additions & 7 deletions libc/fuzzing/__support/CMakeLists.txt

This file was deleted.

70 changes: 0 additions & 70 deletions libc/fuzzing/__support/uint_fuzz.cpp

This file was deleted.

6 changes: 3 additions & 3 deletions libc/src/__support/FPUtil/dyadic_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ template <size_t Bits> struct DyadicFloat {
// significant bit.
LIBC_INLINE constexpr DyadicFloat &normalize() {
if (!mantissa.is_zero()) {
int shift_length = cpp::countl_zero(mantissa);
int shift_length = static_cast<int>(mantissa.clz());
exponent -= shift_length;
mantissa <<= static_cast<size_t>(shift_length);
mantissa.shift_left(static_cast<size_t>(shift_length));
}
return *this;
}
Expand Down Expand Up @@ -233,7 +233,7 @@ LIBC_INLINE constexpr DyadicFloat<Bits> quick_add(DyadicFloat<Bits> a,
result.sign = a.sign;
result.exponent = a.exponent;
result.mantissa = a.mantissa;
if (result.mantissa.add_overflow(b.mantissa)) {
if (result.mantissa.add(b.mantissa)) {
// Mantissa addition overflow.
result.shift_right(1);
result.mantissa.val[DyadicFloat<Bits>::MantissaType::WORD_COUNT - 1] |=
Expand Down

0 comments on commit c874f0d

Please sign in to comment.