Bits, Math and Performance(?)

50% bits, 50% math (allegedly)

Friday, 6 June 2025

From Boolean logic to bitmath and SIMD: transitive closure of tiny graphs

›
Let's say that we have a graph of at most 8 nodes (you can also think of it as a relation between 8 things), represented as an 8 by ...
Tuesday, 10 December 2024

Bit-permuting 16 u32s at once with AVX-512

›
The basic trick to apply the same bit-permutation to each of the u32 s is to view them as matrix of 16 rows by 32 columns, transpose it ...
Sunday, 10 November 2024

Histogramming bytes with positional popcount (GF2P8AFFINEQB edition)

›
A while ago, after some back and forth on twitter/X with @corsix , I dropped some implementation of byte histogramming without explaini...
Thursday, 22 August 2024

Enumerating identities, part 2

›
Part 2 of Enumerating all mathematical identities (in fixed-size bitvector arithmetic with a restricted set of operations) of a certain ...
Tuesday, 18 June 2024

Sorting the nibbles of a u64

›
I was reminded (on mastodon) of this nibble-sorting technique (it could be adapted to other element sizes), which I apparently had only ...
Tuesday, 4 June 2024

Sharpening a lower bound with KnownBits information

›
I have written about this before , but that was a long time ago, I've had a lot more practice with similar things since then. This ...
Monday, 3 June 2024

Multiplying 64x64 bit-matrices with GF2P8AFFINEQB

›
This is a relatively simple use of GF2P8AFFINEQB . By itself GF2P8AFFINEQB essentially multiplies two 8x8 bit-matrices (but with transp...
Tuesday, 28 May 2024

Implementing grevmul with GF2P8AFFINEQB

›
As a reminder, grev is generalized bit-reversal , and performs a bit-permutation that corresponds to XORing the indices of the bits of ...
Thursday, 4 April 2024

Enumerating all mathematical identities (in fixed-size bitvector arithmetic with a restricted set of operations) of a certain size

›
Once again a boring-but-specific title, I don't want to clickbait the audience after all. Even so, let's get some "disclaim...
Saturday, 9 March 2024

The solutions to 𝚙𝚘𝚙𝚌𝚗𝚝(𝚡) < 𝚝𝚣𝚌𝚗𝚝(𝚡) and why there are Fibonacci[n] of them below 2ⁿ

›
popcnt(x) < tzcnt(x) asks the question "does x have fewer set bits than it has trailing zeroes". It's a simple quest...
Wednesday, 17 January 2024

Partial sums of popcount

›
The partial sums of popcount , aka A000788: Total number of 1's in binary expansions of 0, ..., n can be computed fairly efficiently...
Saturday, 23 September 2023

Permuting bits with GF2P8AFFINEQB

›
It's no secret that GF2P8AFFINEQB can be tricky to think about, even in the restricted context of bit-permutations. Thinking about...
Sunday, 2 July 2023

Propagating bounds through bitwise operations

›
This post is meant as a replacement/recap of some work that I did over a decade ago on propagating bounds through bitwise operations, w...
Monday, 12 June 2023

Some ways to check whether an unsigned sum wraps

›
When computing x + y , does the sum wrap? There are various ways to find out, some of them well known, some less. Some of these are pr...
›
Home
View web version

About Me

Harold
View my complete profile
Powered by Blogger.