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



             Bug #: 54978

           Summary: Add ability to provide vectorized functions

    Classification: Unclassified

           Product: gcc

           Version: unknown

            Status: UNCONFIRMED

          Severity: enhancement

          Priority: P3

         Component: tree-optimization

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: ddes...@gmail.com





Presently, the auto-vectorizer chokes on any function calls present in a loop. 

It would be nice to be able to provide vectorized versions of functions, as

well as non-vectorized versions, and let the auto-vectorizer notice these.



This is already done for transcendental functions when -mveclibabi is used. 

However, to do this, some standardized form for the vectorized function would

have to be defined. 



For instance, assuming sse type functions with double precision as an example,

this could be done as follows.



C++: the simple case because overloading is available



double fx(double x);

v2df fx(v2df x);



C: this is more difficult, but something should be doable.  To prevent

accidental name overlap, a new function attribute could be used, to define a

vectorized version, i.e.: 



double fx(double x) __attribute__((vectorized_alias(fxv2df)));

v2df fxv2df(v2df x);

Reply via email to