[PATCH] D157108: APFloat: Add getExactLog2
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 4 14:07:48 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/lib/Support/APFloat.cpp:4306
+ for (int i = 0; i < PartCount; ++i) {
+ PopCount += llvm::popcount(Parts[i]);
+ if (PopCount > 1)
----------------
jcranmer-intel wrote:
> I would like to see a test that exercises the case of two different parts each having popcount = 1. Testing `next(false)` on the existing subnormal checks should do the trick, I think.
if (PartCount == 2) {
assert(!(llvm::popcount(Parts[0]) == 1 && llvm::popcount(Parts[0]) == 1));
}
already fires on the existing tests
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157108/new/
https://reviews.llvm.org/D157108
More information about the llvm-commits
mailing list