News for hackers. Stuff that matters.
Re:Dynamic bit shuffle using AVX-512 by Matumio on Friday June 30, 2023 @08:48AM (#36533908)
I once thought "bit shuffling" was a special-purpose use-case you'd only ever need to deinterleave RGBA channels or something. Later I wanted to implement a small look-up table (surely something more common) and realized that it's just a different name for the same operation. (I think "bit shuffling" instructions have evolved to be generic enough that they're just programmable LUTs now.)
Re:Dynamic bit shuffle using AVX-512 by galangalalgol on Friday June 30, 2023 @08:58AM (#36534048)
Good for software defined radio too because real and imaginary are interleaved.
Re:Dynamic bit shuffle using AVX-512 by tomcam on Friday June 30, 2023 @11:19AM (#36536523)
> because real and imaginary are interleaved.

And so it is in life

Re:Dynamic bit shuffle using AVX-512 by galangalalgol on Friday June 30, 2023 @04:52PM (#36542104)
Yeah, I often talk about the "phase" of a schedule being close to 90. Managers are thinking % but I'm thinking degrees.
Re:Dynamic bit shuffle using AVX-512 by tomcam on Friday June 30, 2023 @05:44PM (#36542782)
Took me a while to comprehend that. NOYCE!
Re:Dynamic bit shuffle using AVX-512 by less_less on Friday June 30, 2023 @10:12AM (#36535261)
Yeah, those vector permute instructions are super useful for both patterns. There are dedicated instructions for some specific permutations (shifting over by a constant number of bytes, and some interleavings) but you can easily end up needing the general case. And of course parallel LUTs are also very useful. Depending on what you're doing you could easily end up with both in the same algorithm.
Re:Dynamic bit shuffle using AVX-512 by no92 on Friday June 30, 2023 @03:36PM (#36540963)
I would have never thought to phrase bit-shuffling as deinterleaving, which makes so much more sense to my not-professionally-computer-related eyes and mind.

Realistically though, how likely would a GCC/clang be to emit these instructions when I'm working on some lookup tables, assuming I permit it to use them (e.g. via `-march=native` on a machine that supports the extension)? My gut feeling would be that unless I specifically make sure to structure my code to be as close to the semantics of the instructions as possible, these instructions would never ever be emitted. Or has the world of compiler optimizers advanced enough that rewriting that is commonplace now?