Page MenuHomePhabricator

Delta-dev-99 (Armando Martín)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 25 2022, 10:22 PM (17 w, 6 d)

Recent Activity

Sep 26 2022

Delta-dev-99 added a comment to D134625: Summary: bug fix! Rotation direction on `__countl_zero()` probably unnoticed because only affects rare cases (does not affect 128 bit ints because rotation is effectively swap) (does not affect integers of sizes less or equal to 64bits).

Possible test case: apply the operation to 256-bit integer 0x8000000000000000000000000000000000000000000000000000000000000000 (first bit from the left is set, all other bits cleared)
Correct answer: 0. The first bit from the left is set.
Current implementation's answer (probably, not tested yet): 128. It counts the bits cleared in the 2 blocks (64 bits each) in the middle of the number (bits 64 to 191) before finding the bit set in the left-most block (block 3).

Sep 26 2022, 2:48 PM · Restricted Project, Restricted Project
Delta-dev-99 added a comment to D134625: Summary: bug fix! Rotation direction on `__countl_zero()` probably unnoticed because only affects rare cases (does not affect 128 bit ints because rotation is effectively swap) (does not affect integers of sizes less or equal to 64bits).

I was playing with the core libraries and details of C++ and tried compiling and running programs without standard libraries and with custom versions of standard library.
I was implementing bit operations and decided to take a look at llvm's implementation to compare with my own. I had a very similar idea, but the rotation direction was different on libcxx.
That's how I found it. I didn't had a test case.

Sep 26 2022, 2:21 PM · Restricted Project, Restricted Project

Sep 25 2022

Delta-dev-99 requested review of D134625: Summary: bug fix! Rotation direction on `__countl_zero()` probably unnoticed because only affects rare cases (does not affect 128 bit ints because rotation is effectively swap) (does not affect integers of sizes less or equal to 64bits).
Sep 25 2022, 11:15 PM · Restricted Project, Restricted Project