home.social

#popcount — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #popcount, aggregated by home.social.

  1. Here's an informal and (hopefully simple to understand) by-example derivation of "next larger integer with same popcount" implementation that saturates to known when none exists. From there builds "closest smaller integer", "at runtime selected direction" and shows the connection to recent post by @harold that walks to "closest". If I didn't screw up it should be UB free.

    marc-b-reynolds.github.io/math

    #bithack #popcount

  2. My insufferable brain keeps repeating to me (for the past week) that if 'x' has popcount 'p' then bit_gather(~0,x) is the integer with the lowest 'p' bits set.

    Maybe this post will make it stop.

    (edit: PEXT on intel)

    #bithack #popcount

  3. New blog post: "Reducing 'gate' counts for Kyber-512: Two algorithm analyses, from first principles, contradicting NIST's calculation." blog.cr.yp.to/20231023-clumpin #xor #popcount #gates #memory #clumping Also via Cloudflare given the frequent DoS attacks: blog-cr-yp-to.viacache.net/202