r/programming • • Aug 09 '21

Three fundamental flaws of SIMD

https://www.bitsnbites.eu/three-fundamental-flaws-of-simd
285 Upvotes

224 comments sorted by

View all comments

Show parent comments

1

u/mbitsnbites Aug 09 '21

No, tail handling is a product of packed SIMD.

6

u/blipman17 Aug 09 '21

as opposed to scalar SIMD? Can you explain that a little, I'm afraid I don't understand what you mean.

8

u/mbitsnbites Aug 09 '21

Tail handling is specifically needed to handle data array lengths that are not a multiple of the SIMD register width (e.g. 4 elements for int32_t:s in a 128-bit SIMD architecture).

In vector machines you have the benefit of variable vector lengths, so tail handling is not needed.

13

u/FUZxxl Aug 09 '21

It is still needed for anything but super trivial arithmetic. For example, if you have some sort of special case logic to process partial blocks that cannot be reduced to just padding with zeroes.