2 ms·
There's really two kinds of vector code in my experience. The first kind is the standard vector code that most people probably think of, the loops that boil dow
by jcranmer 8y ago
There's really two kinds of vector code in my experience. The first kind is the standard vector code that most people probably think of, the loops that boil down to:
#pragma vectorize_me_to_death
for (int i = 0; i < N; i++) {
// ...
}
But there is also a second kind of vector opportunity: small vector opportunities. SLP vectorization is the ur-example here: you scan a block of code for operations that happen to be doing the same operation on different values and make vector code out of it. For this kind of vector code, there is a lot more focus on horizontal and shuffling code than the wide kind of vector code.
I haven't looked at the ARM SVE or RISC-V vector ISAs in detail, but I imagine that they don't support the latter kind of vectorization very well.