From patchwork Fri Dec 4 14:59:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Senkevich X-Patchwork-Id: 9888 Received: (qmail 35240 invoked by alias); 4 Dec 2015 14:59:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 34347 invoked by uid 89); 4 Dec 2015 14:59:43 -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-f181.google.com X-Received: by 10.112.137.132 with SMTP id qi4mr8309242lbb.120.1449241178505; Fri, 04 Dec 2015 06:59:38 -0800 (PST) MIME-Version: 1.0 From: Andrew Senkevich Date: Fri, 4 Dec 2015 17:59:08 +0300 Message-ID: Subject: [PATCH] x86_64: Utilize vector math functions w/o -fopenmp To: libc-alpha Hi, this patch adds GCC 6.* __attribute__((__simd__)) to declaration of vector math functions to utilize them w/o -fopenmp. Libmvec wike page will be updated appropriately with example of usage (w/o -fopenmp will be needed -ftree-loop-vectorize). 2015-12-04 Andrew Senkevich * sysdeps/x86/fpu/bits/math-vector.h: Add __attribute__((__simd__)) to vector functions declaration. Is it Ok for trunk? --- WBR, Andrew diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h index f3bfb86..155d326 100644 --- a/sysdeps/x86/fpu/bits/math-vector.h +++ b/sysdeps/x86/fpu/bits/math-vector.h @@ -53,5 +53,32 @@ # undef __DECL_SIMD_powf # define __DECL_SIMD_powf __DECL_SIMD_x86_64 +# 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 +# undef __DECL_SIMD_cosf +# define __DECL_SIMD_cosf __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_sin +# define __DECL_SIMD_sin __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_sinf +# define __DECL_SIMD_sinf __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_sincos +# define __DECL_SIMD_sincos __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_sincosf +# define __DECL_SIMD_sincosf __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_log +# define __DECL_SIMD_log __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_logf +# define __DECL_SIMD_logf __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_exp +# define __DECL_SIMD_exp __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_expf +# define __DECL_SIMD_expf __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_pow +# define __DECL_SIMD_pow __ATTR_SIMD_x86_64 +# undef __DECL_SIMD_powf +# define __DECL_SIMD_powf __ATTR_SIMD_x86_64 # endif #endif