-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
@llvm/pr-subscribers-libc Author: Krishna Pandey (krishna2803) ChangesFix build-bot failure caused by #125356 Full diff: https://github.com/llvm/llvm-project/pull/126291.diff 1 Files Affected:
diff --git a/libc/src/__support/fixed_point/fx_bits.h b/libc/src/__support/fixed_point/fx_bits.h
index 21985e644253441..b9c065a3226d1c0 100644
--- a/libc/src/__support/fixed_point/fx_bits.h
+++ b/libc/src/__support/fixed_point/fx_bits.h
@@ -188,8 +188,8 @@ countls(T f) {
constexpr int PADDING_LEN = CONTAIN_LEN - FXRep::TOTAL_LEN;
if constexpr (FXRep::SIGN_LEN != 0) {
- if (x < 0)
- x = bit_not(x);
+ if (f < 0)
+ f = bit_not(f);
}
BitType value_bits = FXBits(x)::get_bits();
|
if (x < 0) | ||
x = bit_not(x); | ||
if (f < 0) | ||
f = bit_not(f); | ||
} | ||
|
||
BitType value_bits = FXBits(x)::get_bits(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about x
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah.. sorry about that! fixed in caa32e6e
if (x < 0) | ||
x = bit_not(x); | ||
if (f < 0) | ||
f = bit_not(f); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please remove {}
from if constexpr
.
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in caa32e6e
|
||
BitType value_bits = FXBits(x)::get_bits(); | ||
BitType value_bits = FXBits(f)::get_bits(); |
There was a problem hiding this comment.
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);
| ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was ::
supposed to be .
?
Fix build-bot failure caused by llvm#125356
…126291)" This reverts commit bada922. Revert "[libc][stdfix] Implement fixed point `countlsfx` functions in llvm-libc (llvm#125356)" This reverts commit f2a1103.
Fix build-bot failure caused by #125356