5 ms·
The most unhinged AVX-512 instruction is GF2P8AFFINEQB.
by jonstewart 2y ago
The most unhinged AVX-512 instruction is GF2P8AFFINEQB.
- pclmulqdq 2y agoWhat about GF2P8AFFINEINVQB?
- jonstewart 2y agopotato, potato, tomato, tomato
- LarsKrimi 2y agoIt has a fixed polynomial, so not really that useful for anything but AES The only case where I've had use of GF(2^8) inverses is in FEC algorithms (Forney's algorithm) and then you need some kind of weird polynomial. But all of those needs are rarely in the hot-path, and the FEC algo's are way outdated
- pclmulqdq 2y agoI think the AFFINE and AFFINEINV instructions are specifically for FEC and maybe compression algorithms. I also think they smell like something requested by one of the big customers of Intel (e.g. the government).
- LarsKrimi 2y agoHmm of course erasure codes would always need to solve these problems. Not sure what modern applications need that in the X86 world I really think it's only AES since thats the only place I've seen that polynomial used. But of course maybe there's an obscure tape backup FEC algo used somewhere in datacenters?
- Sesse__ 2y agoThe forward affine matrix is useful for all sorts of bit manipulation, e.g. something as simple as a bit reversal.
- bri3d 2y agoThere's a pretty good list of weird off-label uses for the Galois Field instructions here: https://gist.github.com/animetosho/d3ca95da2131b5813e16b5bb1b137ca0 https://gist.github.com/animetosho/d3ca95da2131b5813e16b5bb1...
- genewitch 2y agoI think I actually need that instruction and have a use case for it, and it does something with a matrix transpose so I might finally find a real world useful demonstration of a matrix operation I can cite to people who don't know what those mean.
- mrandish 2y agoFrom my 1980s 8-bit CPU perspective, the instruction is unhinged based solely on the number of letters. Compared to LDA, STA, RTS, that's not an assembler mnemonic, it's a novel. :-)
- pclmulqdq 2y ago"Load accumulator" (LDA) vs "Galois Field 2^8 affine transform on quad binary words" (GF2P8AFFINEQB) The compression factor isn't quite the same on character count, but it's still abbreviated. :)
- mananaysiempre 2y agoIncidentally, how is it a GF(2^8) affine transform? As best as I can tell, it’s a GF(2)^8 affine transform, i.e. an affine transform of vectors of bits with normal XOR addition and AND multiplication, and the polynomial defining GF(2^8) just does not enter anywhere. It does enter into GF2P8AFFINEINVQB, but I’m having difficulties finding a geometric description for that one at all.
- pclmulqdq 2y agoI believe that the polynomial for GF2P8AFFINEQB is user-defined. One argument is an 8x8 matrix in GF(2) and the result is [A.x + b] in GF(2)^8 for each 8-bit section. Don't quote me on this, but I believe that matrix multiply in GF(2)^8 gets you a transform in GF(2^8).
- inopinatus 2y agoSometimes I read through the instrinsics guide just to play the game of spotting instructions defined primarily because certain cryptologic agencies asked for it.
- camel-cdr 2y agoHere is Knuth introducing the MMIX instruction MXOR, which Intel later defined on vector registers under the name vgf2p8affineqb. https://www.youtube.com/watch?v=r_pPF5npnio&t=3300 https://www.youtube.com/watch?v=r_pPF5npnio&t=3300 (55:00) "This is an instruction that doesn't exist in any computer right now, so why should I put it in a machine, if it's supposed to be realistic? Well, it's because it's ahead of time."
- mschuster91 2y agoMMIX? Now that's something I haven't heard in a long time...