On Tue, 11 Sep 2012, Jakub Jelinek wrote:

On Tue, Sep 11, 2012 at 12:29:10PM +0200, Marc Glisse wrote:
Note that, apart from preventing external calls, it removes this use case:

__attribute__((vector(4))) double mysqrt(double x){return sqrt(x);}

__m256d var;
mysqrt(var);

I don't think those functions should be available for C++ overloading.

The current patch does make them available, according to their author.

For one, it would be only for C++, not for C, and how would you handle
the case where the user already provides __m256d mysqrt(__m256d); overload
in addition to the one with vector attribute?

The same way you handle it when the user provides 2 identical overloads.

I'd say the compiler should when beneficial synthetize calls to those
in SLP or normal vectorizer instead, so you'd write:
 (__m256d){mysqrt(var[0]),mysqrt(var[1]),mysqrt(var[2]),mysqrt(var[3])};
instead of mysqrt(var); and the compiler would turn that into
 mysqrt.elem.V4DF(var)
(or whatever the mangling of the elemental functions would be).

Ok.

--
Marc Glisse

Reply via email to