Discussion:
GCC vectorization of math functions similar to what LLVM does...
leon zadorin
2014-09-25 13:27:04 UTC
Permalink
Hello,

a quick question on whether GCC can do (auto) vectorization of math
functions like pow, exp, log, sin, cos, et. al. as per similar to what
LLVM suggests of being able to do:
http://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls

Is GCC (e.g. 4.9.1) capable of something similar?

Regards
Leon.
James Greenhalgh
2014-09-26 11:12:16 UTC
Permalink
Post by leon zadorin
Hello,
a quick question on whether GCC can do (auto) vectorization of math
functions like pow, exp, log, sin, cos, et. al. as per similar to what
http://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls
Is GCC (e.g. 4.9.1) capable of something similar?
Yes, though as with LLVM, which builtin functions are considered for
vectorization will depend on the architecture you are targetting.

The relevant target hook to look for in the GCC sources is
"TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION" [1].

Cheers,
James

---

[1] https://gcc.gnu.org/onlinedocs/gccint/Addressing-Modes.html#Addressing-Modes
Loading...