This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/54978] New: Add ability to provide vectorized functions


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: unassigned@gcc.gnu.org
        ReportedBy: ddesics@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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]