Message ID | CAMXFM3t8tH3Sd+0Uny86DoJpou554cwcxO5rHxYh+zzhj0f6Fg@mail.gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 124141 invoked by alias); 4 Dec 2015 17:28:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 124129 invoked by uid 89); 4 Dec 2015 17:28:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f178.google.com X-Received: by 10.112.25.40 with SMTP id z8mr8838043lbf.13.1449250094630; Fri, 04 Dec 2015 09:28:14 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <alpine.DEB.2.10.1512041544170.29136@digraph.polyomino.org.uk> References: <CAMXFM3tOcznwyGywfCLf1baLW6rLyUdnX1SZe6-AGh41Wb0mqA@mail.gmail.com> <alpine.DEB.2.10.1512041544170.29136@digraph.polyomino.org.uk> From: Andrew Senkevich <andrew.n.senkevich@gmail.com> Date: Fri, 4 Dec 2015 20:27:45 +0300 Message-ID: <CAMXFM3t8tH3Sd+0Uny86DoJpou554cwcxO5rHxYh+zzhj0f6Fg@mail.gmail.com> Subject: Re: [PATCH] x86_64: Utilize vector math functions w/o -fopenmp To: Joseph Myers <joseph@codesourcery.com> Cc: libc-alpha <libc-alpha@sourceware.org> Content-Type: text/plain; charset=UTF-8 |
Commit Message
Andrew Senkevich
Dec. 4, 2015, 5:27 p.m. UTC
2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: > On Fri, 4 Dec 2015, Andrew Senkevich wrote: > >> +# elif __GNUC_PREREQ (6,0) >> +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ >> +# define __ATTR_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) >> +# undef __DECL_SIMD_cos >> +# define __DECL_SIMD_cos __ATTR_SIMD_x86_64 > > Why do you need to duplicate the list of functions? It would seem better > to define __DECL_SIMD_x86_64 with two different definitions depending on > the macros predefined by the compiler, then define all the > __DECL_SIMD_<func> macros if __DECL_SIMD_x86_64 has been defined. > > # if defined _OPENMP && _OPENMP >= 201307 > # define __DECL_SIMD_x86_64 ... > # elif __GNUC_PREREQ (6,0) > # define __DECL_SIMD_x86_64 ... > # endif > # ifdef __DECL_SIMD_x86_64 > # undef __DECL_SIMD_cos > # define __DECL_SIMD_cos __DECL_SIMD_x86_64 > etc. Indeed, and patch became much shorter -- WBR, Andrew
Comments
On Fri, 4 Dec 2015, Andrew Senkevich wrote: > Indeed, and patch became much shorter > > diff --git a/sysdeps/x86/fpu/bits/math-vector.h > b/sysdeps/x86/fpu/bits/math-vector.h > index f3bfb86..13d720e 100644 > --- a/sysdeps/x86/fpu/bits/math-vector.h > +++ b/sysdeps/x86/fpu/bits/math-vector.h > @@ -28,6 +28,12 @@ > # if defined _OPENMP && _OPENMP >= 201307 > /* OpenMP case. */ > # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") > +# elif __GNUC_PREREQ (6,0) > +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ > +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) This shorter patch is OK with spaces added between __attribute__ and '(', and between __simd__ and '('.
On Fri, 2015-12-04 at 20:27 +0300, Andrew Senkevich wrote: > 2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: > diff --git a/sysdeps/x86/fpu/bits/math-vector.h > b/sysdeps/x86/fpu/bits/math-vector.h > index f3bfb86..13d720e 100644 > --- a/sysdeps/x86/fpu/bits/math-vector.h > +++ b/sysdeps/x86/fpu/bits/math-vector.h > @@ -28,6 +28,12 @@ > # if defined _OPENMP && _OPENMP >= 201307 > /* OpenMP case. */ > # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") > +# elif __GNUC_PREREQ (6,0) > +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ > +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) > +# endif > + > +# ifdef __DECL_SIMD_x86_64 > # undef __DECL_SIMD_cos > # define __DECL_SIMD_cos __DECL_SIMD_x86_64 > # undef __DECL_SIMD_cosf I believe this might be what breaks a build on a recent GCC: ../math/bits/mathcalls.h:63:1: error: wrong number of arguments specified for ‘__simd__’ attribute __MATHCALL_VEC (cos,, (_Mdouble_ __x)); Or perhaps GCC has a bug. Could somebody have a look please?
2015-12-18 1:44 GMT+03:00 Torvald Riegel <triegel@redhat.com>: > On Fri, 2015-12-04 at 20:27 +0300, Andrew Senkevich wrote: >> 2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: >> diff --git a/sysdeps/x86/fpu/bits/math-vector.h >> b/sysdeps/x86/fpu/bits/math-vector.h >> index f3bfb86..13d720e 100644 >> --- a/sysdeps/x86/fpu/bits/math-vector.h >> +++ b/sysdeps/x86/fpu/bits/math-vector.h >> @@ -28,6 +28,12 @@ >> # if defined _OPENMP && _OPENMP >= 201307 >> /* OpenMP case. */ >> # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") >> +# elif __GNUC_PREREQ (6,0) >> +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ >> +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) >> +# endif >> + >> +# ifdef __DECL_SIMD_x86_64 >> # undef __DECL_SIMD_cos >> # define __DECL_SIMD_cos __DECL_SIMD_x86_64 >> # undef __DECL_SIMD_cosf > > I believe this might be what breaks a build on a recent GCC: > > ../math/bits/mathcalls.h:63:1: error: wrong number of arguments > specified for ‘__simd__’ attribute > __MATHCALL_VEC (cos,, (_Mdouble_ __x)); > > Or perhaps GCC has a bug. Could somebody have a look please? Hi, do you use trunk GCC? -- WBR, Andrew
On Fri, 2015-12-18 at 16:45 +0300, Andrew Senkevich wrote: > 2015-12-18 1:44 GMT+03:00 Torvald Riegel <triegel@redhat.com>: > > On Fri, 2015-12-04 at 20:27 +0300, Andrew Senkevich wrote: > >> 2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: > >> diff --git a/sysdeps/x86/fpu/bits/math-vector.h > >> b/sysdeps/x86/fpu/bits/math-vector.h > >> index f3bfb86..13d720e 100644 > >> --- a/sysdeps/x86/fpu/bits/math-vector.h > >> +++ b/sysdeps/x86/fpu/bits/math-vector.h > >> @@ -28,6 +28,12 @@ > >> # if defined _OPENMP && _OPENMP >= 201307 > >> /* OpenMP case. */ > >> # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") > >> +# elif __GNUC_PREREQ (6,0) > >> +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ > >> +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) > >> +# endif > >> + > >> +# ifdef __DECL_SIMD_x86_64 > >> # undef __DECL_SIMD_cos > >> # define __DECL_SIMD_cos __DECL_SIMD_x86_64 > >> # undef __DECL_SIMD_cosf > > > > I believe this might be what breaks a build on a recent GCC: > > > > ../math/bits/mathcalls.h:63:1: error: wrong number of arguments > > specified for ‘__simd__’ attribute > > __MATHCALL_VEC (cos,, (_Mdouble_ __x)); > > > > Or perhaps GCC has a bug. Could somebody have a look please? > > Hi, > > do you use trunk GCC? Yes, "recent GCC" was supposed to mean GCC trunk from yesterday or so.
2015-12-18 18:29 GMT+03:00 Torvald Riegel <triegel@redhat.com>: > On Fri, 2015-12-18 at 16:45 +0300, Andrew Senkevich wrote: >> 2015-12-18 1:44 GMT+03:00 Torvald Riegel <triegel@redhat.com>: >> > On Fri, 2015-12-04 at 20:27 +0300, Andrew Senkevich wrote: >> >> 2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: >> >> diff --git a/sysdeps/x86/fpu/bits/math-vector.h >> >> b/sysdeps/x86/fpu/bits/math-vector.h >> >> index f3bfb86..13d720e 100644 >> >> --- a/sysdeps/x86/fpu/bits/math-vector.h >> >> +++ b/sysdeps/x86/fpu/bits/math-vector.h >> >> @@ -28,6 +28,12 @@ >> >> # if defined _OPENMP && _OPENMP >= 201307 >> >> /* OpenMP case. */ >> >> # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") >> >> +# elif __GNUC_PREREQ (6,0) >> >> +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ >> >> +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) >> >> +# endif >> >> + >> >> +# ifdef __DECL_SIMD_x86_64 >> >> # undef __DECL_SIMD_cos >> >> # define __DECL_SIMD_cos __DECL_SIMD_x86_64 >> >> # undef __DECL_SIMD_cosf >> > >> > I believe this might be what breaks a build on a recent GCC: >> > >> > ../math/bits/mathcalls.h:63:1: error: wrong number of arguments >> > specified for ‘__simd__’ attribute >> > __MATHCALL_VEC (cos,, (_Mdouble_ __x)); >> > >> > Or perhaps GCC has a bug. Could somebody have a look please? >> >> Hi, >> >> do you use trunk GCC? > > Yes, "recent GCC" was supposed to mean GCC trunk from yesterday or so. I asked because I didn't see fail of Glibc build with today GCC. Is it reproduced with GCC trunk? -- WBR, Andrew
On Fri, 2015-12-18 at 20:20 +0300, Andrew Senkevich wrote: > 2015-12-18 18:29 GMT+03:00 Torvald Riegel <triegel@redhat.com>: > > On Fri, 2015-12-18 at 16:45 +0300, Andrew Senkevich wrote: > >> 2015-12-18 1:44 GMT+03:00 Torvald Riegel <triegel@redhat.com>: > >> > On Fri, 2015-12-04 at 20:27 +0300, Andrew Senkevich wrote: > >> >> 2015-12-04 18:46 GMT+03:00 Joseph Myers <joseph@codesourcery.com>: > >> >> diff --git a/sysdeps/x86/fpu/bits/math-vector.h > >> >> b/sysdeps/x86/fpu/bits/math-vector.h > >> >> index f3bfb86..13d720e 100644 > >> >> --- a/sysdeps/x86/fpu/bits/math-vector.h > >> >> +++ b/sysdeps/x86/fpu/bits/math-vector.h > >> >> @@ -28,6 +28,12 @@ > >> >> # if defined _OPENMP && _OPENMP >= 201307 > >> >> /* OpenMP case. */ > >> >> # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") > >> >> +# elif __GNUC_PREREQ (6,0) > >> >> +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ > >> >> +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) > >> >> +# endif > >> >> + > >> >> +# ifdef __DECL_SIMD_x86_64 > >> >> # undef __DECL_SIMD_cos > >> >> # define __DECL_SIMD_cos __DECL_SIMD_x86_64 > >> >> # undef __DECL_SIMD_cosf > >> > > >> > I believe this might be what breaks a build on a recent GCC: > >> > > >> > ../math/bits/mathcalls.h:63:1: error: wrong number of arguments > >> > specified for ‘__simd__’ attribute > >> > __MATHCALL_VEC (cos,, (_Mdouble_ __x)); > >> > > >> > Or perhaps GCC has a bug. Could somebody have a look please? > >> > >> Hi, > >> > >> do you use trunk GCC? > > > > Yes, "recent GCC" was supposed to mean GCC trunk from yesterday or so. I take that back. The GCC build I used was somewhat older. I can't reproduce the glibc build problem with a build of today's GCC trunk anymore, I think. I get a different glibc build problem, but in a test that is later than math/ I believe. Sorry for the noise.
diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h index f3bfb86..13d720e 100644 --- a/sysdeps/x86/fpu/bits/math-vector.h +++ b/sysdeps/x86/fpu/bits/math-vector.h @@ -28,6 +28,12 @@ # if defined _OPENMP && _OPENMP >= 201307 /* OpenMP case. */ # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") +# elif __GNUC_PREREQ (6,0) +/* W/o OpenMP use GCC 6.* __attribute__((__simd__)). */ +# define __DECL_SIMD_x86_64 __attribute__((__simd__("notinbranch"))) +# endif + +# ifdef __DECL_SIMD_x86_64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_x86_64 # undef __DECL_SIMD_cosf