[PATCH] D30780: [APInt] Add APInt::insertBits() method to insert an APInt into a larger APInt

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 07:08:56 PST 2017


filcab accepted this revision.
filcab added a comment.
This revision is now accepted and ready to land.

LGTM, but maybe wait a bit to let other people chime in.
Thank you!



================
Comment at: unittests/ADT/APIntTest.cpp:1674
+  EXPECT_EQ(48u, i127.countTrailingOnes());
+  EXPECT_EQ(105u, i127.countPopulation());
+
----------------
Why not this?
```EXPECT_EQ((i127&UINT64_MAX).getZExtValue(), 0x3456ffffffffffff);
EXPECT_EQ((i127>>64).getZExtValue(), 0x7ffffffffff8012);```
(Please double check the values)


Repository:
  rL LLVM

https://reviews.llvm.org/D30780





More information about the llvm-commits mailing list