Skip to content

[libc][stdfix] Fix buildbot failure because of a typo. #126291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions libc/src/__support/fixed_point/fx_bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,11 @@ countls(T f) {
constexpr int CONTAIN_LEN = cpp::numeric_limits<BitType>::digits;
constexpr int PADDING_LEN = CONTAIN_LEN - FXRep::TOTAL_LEN;

if constexpr (FXRep::SIGN_LEN != 0) {
if (x < 0)
x = bit_not(x);
}
if constexpr (FXRep::SIGN_LEN != 0)
if (f < 0)
f = bit_not(f);

BitType value_bits = FXBits(x)::get_bits();
BitType value_bits = FXBits(f)::get_bits();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still failing on the buildbots:

libc/src/__support/fixed_point/fx_bits.h:194:11: error: no viable conversion from 'FXBits' (aka 'FXBits<unsigned long _Fract>') to 'BitType' (aka 'unsigned int')
  194 |   BitType value_bits = FXBits(f)::get_bits();
      |           ^            ~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-bootstrap-build/llvm-project/libc/src/stdfix/countlsulr.cpp:17:23: note: in instantiation of function template specialization '__llvm_libc_20_0_0_git::fixed_point::countls<unsigned long _Fract>' requested here
   17 |   return fixed_point::countls(f);
      |                       ^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was :: supposed to be .?

return cpp::countl_zero(value_bits) - PADDING_LEN;
}

Expand Down