4 ms·
My vote is that pext and pdep are the highlight from BMI2.
by mcbain 4y ago
My vote is that pext and pdep are the highlight from BMI2.
- planede 4y agoJust be aware that even though these instructions are supported on pre-zen3 AMD, they are pretty much emulated and not very fast. Otherwise I agree that these are awesome, I know a fast Hilbert-curve implementation using those.
- klodolph 4y agoYes, there’s the annoying tendency of extensions to be slow on the first generation of processors that support them, and then faster afterwards.
- planede 4y agoWhile that's true, the PDEP/PEXT numbers are a bit on the extreme side on AMD early generations. On Zen1 and Zen2 these instructions have latency and rthroughput of 18 and 19 clock cycles respectively. On Zen3 it's a perfectly sensible 3 cycle latency and 1 cycle rthroughput [1]. I'm not aware of an other extensions with such a slow implementation in first generations. [1] https://www.agner.org/optimize/instruction_tables.pdf https://www.agner.org/optimize/instruction_tables.pdf It's unfortunate that PDEP and PEXT is part of BMI2. AMD probably wanted to push BMI2 for the other instructions and they had to include emulated PDEP and PEXT before they had a proper implementation for those.