3 ms·
One corner case that exists is that using AVX instructions imposes a frequency limit, although this isn't the case for SSE instructions. There exist some vecto
by jcranmer 7y ago
One corner case that exists is that using AVX instructions imposes a frequency limit, although this isn't the case for SSE instructions.
There exist some vector instructions that are going to be slower than a non-equivalent sequence of scalar instructions: VPGATHER is going to be an easy such case.
However, I doubt there are going to be any cases where a vector instruction will take fewer clock cycles than its equivalent scalarized instructions. There are some where it might be equivalent--a vector of 2 elements performing an operation that can be issued twice a cycle is an easy example--but I can't think of any where it would be worse. If that were the case, then you should just implement the operation in hardware by scalarizing the uops (and some instructions appear to be so implemented--e.g., gather/scatter).
- vardump 7y agoVPGATHER is actually significantly faster than scalar loads at least on Skylake, possibly on some earlier CPUs as well (Broadwell?). On Haswell where it was first introduced... yeah, not very fast, like you mentioned.