Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-10-24 Thread Jason Merrill
On Tue, Oct 24, 2017 at 3:36 PM, Jakub Jelinek wrote: > On Tue, Oct 24, 2017 at 01:55:58PM -0400, Jason Merrill wrote: >> On Tue, Oct 24, 2017 at 11:33 AM, Jakub Jelinek wrote: >> > On Tue, Oct 24, 2017 at 11:06:51AM -0400, Jason Merrill wrote: >> >> On

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-10-24 Thread Jakub Jelinek
On Tue, Oct 24, 2017 at 01:55:58PM -0400, Jason Merrill wrote: > On Tue, Oct 24, 2017 at 11:33 AM, Jakub Jelinek wrote: > > On Tue, Oct 24, 2017 at 11:06:51AM -0400, Jason Merrill wrote: > >> On 09/29/2017 08:32 AM, Jakub Jelinek wrote: > >> > + tree b =

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-10-24 Thread Jason Merrill
On Tue, Oct 24, 2017 at 11:33 AM, Jakub Jelinek wrote: > On Tue, Oct 24, 2017 at 11:06:51AM -0400, Jason Merrill wrote: >> On 09/29/2017 08:32 AM, Jakub Jelinek wrote: >> > + tree b = builtin_decl_explicit (DECL_FUNCTION_CODE (newdecl)); >> > + if (b) >> > +

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-10-24 Thread Jakub Jelinek
On Tue, Oct 24, 2017 at 11:06:51AM -0400, Jason Merrill wrote: > On 09/29/2017 08:32 AM, Jakub Jelinek wrote: > > + tree b = builtin_decl_explicit (DECL_FUNCTION_CODE (newdecl)); > > + if (b) > > + duplicate_one_attribute (_ATTRIBUTES (b), > > +

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-10-24 Thread Jason Merrill
On 09/29/2017 08:32 AM, Jakub Jelinek wrote: + tree b = builtin_decl_explicit (DECL_FUNCTION_CODE (newdecl)); + if (b) + duplicate_one_attribute (_ATTRIBUTES (b), +DECL_ATTRIBUTES (newdecl), +"omp

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-09-29 Thread Joseph Myers
On Fri, 29 Sep 2017, Jakub Jelinek wrote: > Here is a patch which does that. Also bootstrapped/regtested on > x86_64-linux and i686-linux, ok for trunk? > * c-decl.c (merge_decls): Copy "omp declare simd" attributes from > newdecl to corresponding __builtin_ if any. The C front-end

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-09-29 Thread Jakub Jelinek
On Tue, Sep 12, 2017 at 09:49:20AM +0200, Jakub Jelinek wrote: > On Sat, Sep 09, 2017 at 03:42:35PM +0200, Jason Merrill wrote: > > On Fri, Sep 1, 2017 at 1:12 PM, Jakub Jelinek wrote: > > > + tree s = lookup_attribute ("omp declare simd", > > > +

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-09-12 Thread Jakub Jelinek
On Sat, Sep 09, 2017 at 03:42:35PM +0200, Jason Merrill wrote: > On Fri, Sep 1, 2017 at 1:12 PM, Jakub Jelinek wrote: > > + tree s = lookup_attribute ("omp declare simd", > > +DECL_ATTRIBUTES (newdecl)); > > +

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-09-09 Thread Jason Merrill
On Fri, Sep 1, 2017 at 1:12 PM, Jakub Jelinek wrote: > + tree s = lookup_attribute ("omp declare simd", > +DECL_ATTRIBUTES (newdecl)); > + if (s) > + { > + tree b >

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-09-01 Thread Jakub Jelinek
On Mon, Aug 07, 2017 at 05:27:42PM +0200, Jakub Jelinek wrote: > > This should really be a separate function. Perhaps "merge_one_attribute"? > > If it is outlined without the first 7 lines, i.e. just the body of if (b), > then it could be duplicate_one_attribute (tree *, tree, const char *); >

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jonathan Wakely
On 07/08/17 23:02 +0200, Jakub Jelinek wrote: On Mon, Aug 07, 2017 at 09:59:04PM +0100, Jonathan Wakely wrote: > If it is outlined without the first 7 lines, i.e. just the body of if (b), > then it could be duplicate_one_attribute (tree *, tree, const char *); > called like if (b)

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jakub Jelinek
On Mon, Aug 07, 2017 at 09:59:04PM +0100, Jonathan Wakely wrote: > > If it is outlined without the first 7 lines, i.e. just the body of if (b), > > then it could be duplicate_one_attribute (tree *, tree, const char *); > > called like if (b) duplicate_one_attribute (_ATTRIBUTES (b), s, "omp > >

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jonathan Wakely
On 07/08/17 17:27 +0200, Jakub Jelinek wrote: On Mon, Aug 07, 2017 at 10:54:18AM -0400, Jason Merrill wrote: On 08/07/2017 05:08 AM, Jakub Jelinek wrote: > +tree s = lookup_attribute ("omp declare simd", > + DECL_ATTRIBUTES (newdecl)); > +

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jakub Jelinek
On Mon, Aug 07, 2017 at 10:54:18AM -0400, Jason Merrill wrote: > On 08/07/2017 05:08 AM, Jakub Jelinek wrote: > > + tree s = lookup_attribute ("omp declare simd", > > +DECL_ATTRIBUTES (newdecl)); > > + if (s) > > + { > >

Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jason Merrill
On 08/07/2017 05:08 AM, Jakub Jelinek wrote: + tree s = lookup_attribute ("omp declare simd", +DECL_ATTRIBUTES (newdecl)); + if (s) + { + tree b + =

[PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)

2017-08-07 Thread Jakub Jelinek
Hi! glibc for -ffast-math annotates a couple of math functions with simd attribute, so that one can use vectorized versions with 4/8/16 vectorization factor. If one uses ::cos or ::cosf or std::cos(double), this works just fine, but not when using std::cos(float). This is because the libstdc++