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] Add ability to provide vectorized functions


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-19
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-19 08:45:27 UTC ---
Note that the Cilk+ people have something like this in mind (with an
'elemental' attribute).  The ABI (and thus the mangling) would be static,
thus C++ overloading would not work (but the vectorized function name
would be constructed similar to those of the intrinsics for -mveclibabi).
To adjust your example:

double fx (double) __attribute__((vector));

would tell GCC that a function named (for example) fx_v2df is available,
as well as a function named fx_v4df in case AVX is enabled (and a gazillion
more variants dependent on the target capabilities ...).

Another proposal was that GCC builds those variants itself as needed
(obviously only if it can see the function body).  This is what Cilk+
people designed:

double fx (double x) __attribute__((elemental))
{
  ...
}

would mean the function has to be necessarily 'const' (the return value
is only dependent on arguments, it does not read from memory or has
any side-effects) and the compiler can substitute all double types by
appropriate vector types.


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