E: there are more cases where AVX-512 is really doing something on Zen 4, despite the 256-bit implementation. Take vpermb. Already the 256-bit version gives you something that was annoying to do with AVX2. The 512-bit version runs at halved throughput, which is still 1 per cycle, and would be even more annoying to do with only AVX2. Then there are things like vpopcntb/w/d/q, vplzcntd/q, and so on. You can do them with AVX2 if you must, but it was never nice.
True, although I was referring to the Zen 4 hardware implementation as it's kind of bolted on to the underlying 256-bit units.
Agreed AVX-512 is absolutely a better instruction set so it's worth it in that sense, but the general rule of thumb is that (a) Zen 4 AVX2 vs AVX-512 performance is generally near 1:1 and (b) Zen 5 is 1.8-2x Zen 4 for AVX-512 as it's a native implementation.
I did a lot of profiling on a 7950X vs 9950X3D2 and this held up across auto-vectorized, hand-rolled intrinsics and optimised libraries such as OpenBLAS (the extra cache on the 9950X3D2 probably helped in real-word perf also).
For vpcompressd specifically if you don't care about overstore it's 1.33 cycles vs 1.0 and then a regular store so maybe quite close. If you want masked store then you're back to around 2x for the extra instructions described in the blog post.
View all comments
Show parent comment
10
u/Successful_Yam_9023 May 27 '26 edited May 27 '26
For emulation of
vpcompressdon AVX2 you'd be looking at something like this, times two because it's 256-bit (also mentioned in the article) or use the oldLeftPack_SSSE3but 4x, compared to 2 µops for 512-bitvpcompressdon Zen 4E: there are more cases where AVX-512 is really doing something on Zen 4, despite the 256-bit implementation. Take
vpermb. Already the 256-bit version gives you something that was annoying to do with AVX2. The 512-bit version runs at halved throughput, which is still 1 per cycle, and would be even more annoying to do with only AVX2. Then there are things likevpopcntb/w/d/q,vplzcntd/q, and so on. You can do them with AVX2 if you must, but it was never nice.