Can operations be auto-vectorized on struct's field referenced by pointer?

Posted by Eonil on Stack Overflow See other posts from Stack Overflow or by Eonil
Published on 2010-05-01T06:27:59Z Indexed on 2010/05/01 6:37 UTC
Read the original article Hit count: 251

Filed under:
|
|

This is my code.

inline void inv(Vector* target)
{
 (*target).x = -(*target).x;
 (*target).y = -(*target).y;
 (*target).z = -(*target).z;
 (*target).w = -(*target).w;
}

I'm using GCC. Can this be vectorized?

PS: I'm trying some kind of optimization. Any recommendations are welcome.

© Stack Overflow or respective owner

Related posts about auto-vectorization

Related posts about gcc