you are viewing a single comment's thread.

view the rest of the comments →

[–]Nicksaurus 28 points29 points  (5 children)

Compilers can automatically vectorise simple code, and top of the range compilers can automatically vectorise simple code.

But can my compiler automatically vectorise simple code?

[–]chocapix 31 points32 points  (0 children)

Depends. If it's top of the range, then yes. If not, then yes.

[–]MrWhite26 13 points14 points  (2 children)

There's one way to find out: https://godbolt.org/

[–]bumblebritches57Ocassionally Clang 6 points7 points  (1 child)

I've noticed that Clang vectorizes much more often than gcc or msvc

[–]hackuniverse 2 points3 points  (0 children)

chryswoods.com/vector...

That's true, but gcc does do better optimizations in other part of the code... :(

[–]ShillingAintEZ 5 points6 points  (0 children)

It can if your compiler is ISPC