Live data from Hacker News

The NSA Instruction (2019)

vaibhavsagar.com

1–10 of 98 posts

Re: The NSA Instruction (2019)

#5

I have always been a lurker and I am trying to add my account to my Keybase but it requires 2 karma. Could a few kind sirs give me the juice?

Not gonna spam. Just this one comment to do and hope it works out. Edit- Thank you to the two who did but sadly someone down voted so my total is 1.

I respect the community. I don't wish to spam just trying to take control of all online identities.

Re: The NSA Instruction (2019)

#8
Here's a dumb question. If someone asked me to do it I'd probably write code like:

while(x != 0) { c += x&1; x >>= 1; }

Is this something that should be added to LLVM?

Edit: flip the order

Re: The NSA Instruction (2019)

#9
post #8

Here's a dumb question. If someone asked me to do it I'd probably write code like: while(x != 0) { c += x&1; x >>= 1; } Is this something that should be added to LLVM? Edit: flip the order

Popcount is easily recognized by llvm (and it’s actually mentioned in the article...)

In the case of the code you’ve posted, you’re shifting out the LSB before you check the bit, so it’s not quite right, but (in general) popcount is recognized and used when possible.

Post reply on HN