On Fri, Oct 31, 2025 at 09:21:20AM +0100, Stefano Brivio wrote:
On Fri, 31 Oct 2025 13:47:10 +1100 David Gibson
wrote: On Thu, Oct 30, 2025 at 09:24:04PM +0100, Stefano Brivio wrote:
On Sat, 11 Oct 2025 15:48:23 +1100 David Gibson
wrote: [snip] void bitmap_or(uint8_t *dst, size_t size, const uint8_t *a, const uint8_t *b) { unsigned long *dw = (unsigned long *)dst; @@ -365,6 +367,27 @@ void bitmap_or(uint8_t *dst, size_t size, const uint8_t *a, const uint8_t *b) dst[i] = a[i] | b[i]; }
+/** + * bitmap_andc() - Logical conjunction with complement (AND NOT) of bitmap
Nit: this function name mixes classic logic terminology (conjunction, complement) and operator names (and, not), which makes it hard to guess, I think.
That's my POWER background showing: https://www.ibm.com/docs/en/aix/7.3.0?topic=set-andc-complement-instruction
I obviously don't have a POWER background but I do remember a couple of instructions simply because I found their names hilariously dissonant (other than finding them in whatever disassembly I was looking at). My favourite mouthful is RLWIMI:
Yes, rlwimi is fun. Along with rlwimn, and once you go 64-bit rldimi, rldicr and rldicl. They're utterly inscrutable when you first encounter them, but are super useful and natural once you get used to them. Well, rlwimi and rlwimn at least. The 64-bit bit versions are upsettingly less general, simply because there aren't enough bits in an instruction to encode true equivalents of the 32-bit versions.
https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.3?topic=rf-rldimi-buil...
but ANDC is also remarkable (cf. ANDN in the successful CISC set, which obviously sounds like the only right choice to me).
And, of course, there's "eieio". -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson