Is It Useful?
We’ve seen that it’s possible to specify vector data types that will have the correct alignment on whatever platform they’re compiled for. This alone is quite useful when writing vector code, since data layout can be difficult—particularly if different platforms have different alignment requirements. The next version of SSE is expected to add scatter/gather instructions to alleviate this problem, but there are still a lot of legacy machines around without this functionality.
Being able to do simple arithmetic on vectors is very useful in many applications. Even without using the advanced features of an instruction set, you still can get a lot of throughput by making judicious use of basic arithmetic. It’s also very easy to use our vector types with architecture-specific vector intrinsics.
Whether these benefits are worth losing portability between compilers is a decision that can only be made on a case-by-case basis. Some people argue that if you want code to run fast, GCC is the wrong tool to use. Personally, I find GCC adequate, and this application can give it a nice speed boost when used correctly.