http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54978



--- Comment #3 from Daniel Davis <ddesics at gmail dot com> 2012-10-19 16:14:36 
UTC ---

Obviously, it would be nice if gcc can build the functions if they are pure

functions.  But that would require somehow knowing that those functions should

be built and having access to the code, which may not be the case for something

like a library.  



On second thought, the attribute would best go with declaration of the

vectorized function.  So, to rewrite my example, 



double fx(double x); 

v2df fx_v2df(v2df x) __attribute__((vectorized_alias(fx,double,16))); 

v4df fx_v4df(v4df x) __attribute__((vectorized_alias(fx,double,32)));



That would let the compiler know exactly what could be replaced, although it

should be able to figure out the argument types from the declarations.



So I see two potential optimizations here.  The first is a way to let the

compiler know that vectorized functions are available.  The second would be to

let the auto-vectorizer create vectorized forms of functions.

Reply via email to