From patchwork Wed Feb 20 13:52:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 31534 Received: (qmail 56409 invoked by alias); 20 Feb 2019 13:52:42 -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 56400 invoked by uid 89); 20 Feb 2019 13:52:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Subject: Re: [PATCH] Add new Fortran vector math header file. To: Zack Weinberg Cc: Joseph Myers , GNU C Library References: <863ffa3b-af66-7d82-21a8-e809fd6c1b62@suse.cz> <08214004-67b7-ce24-07ec-3cd685c65038@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <84b2b212-a70a-e18a-5929-d89d6014fb70@suse.cz> Date: Wed, 20 Feb 2019 14:52:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: On 2/20/19 2:05 PM, Zack Weinberg wrote: > On Wed, Feb 20, 2019 at 4:43 AM Martin Liška wrote: >> On 2/19/19 8:14 PM, Zack Weinberg wrote: >>> My first reaction is to wonder whether math-vector-fortran.h should >>> have an extension other than .h. I don't know what conventions there >>> are for this sort of thing in Fortran, but if it could have some other >>> extension then it would be easy to exclude it from this test in the >>> makefiles. Another possibility is to put an Emacs-style "mode" >>> annotation on the first line of the file: -*- f90 -*- which I could >>> make my test program recognize and skip the file. >> >> Hi. >> >> I prefer to do the annotation instead of changing the file extension. >> Can you please verify it's correct in the attached patch? > > Yes, these annotations are correct. You don't have to put them on a > line by themselves, though, > > +! Platform-specific Fortran SIMD declarations of math functions. -*- f90 -*- > > would also work. As long as I'm looking at this patch, I have two > editorial notes: > > In both new files, "Platform-specific Fortran SIMD declarations of > math functions" would be clearer with different word order: suggest > "Platform-specific declarations of SIMD math functions for Fortran." > > In the generic file, "Get default empty builtin definitiones." has a > typo ("definitiones" should be "definitions"), and having a sentence > starting with "Get" on the last line of the file makes it look like > there's something missing. Suggest instead "No SIMD math functions > are available for this platform." > > zw > Thank you for the corrections. I'm attaching final version of the patch that I'm going to install. Martin From 4c3b0fd3da9ed3c6d69892cce37206e6f3405bc4 Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 18 Feb 2019 15:24:12 +0100 Subject: [PATCH] Add new Fortran vector math header file. ChangeLog: 2019-02-18 Martin Liska * math/Makefile: Install math-vector-fortran.h. * bits/math-vector-fortran.h: New file. * sysdeps/x86/fpu/bits/math-vector-fortran.h: New file. --- bits/math-vector-fortran.h | 19 ++++++++++ math/Makefile | 1 + sysdeps/x86/fpu/bits/math-vector-fortran.h | 43 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 bits/math-vector-fortran.h create mode 100644 sysdeps/x86/fpu/bits/math-vector-fortran.h diff --git a/bits/math-vector-fortran.h b/bits/math-vector-fortran.h new file mode 100644 index 0000000000..7c1e095094 --- /dev/null +++ b/bits/math-vector-fortran.h @@ -0,0 +1,19 @@ +! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*- +! Copyright (C) 2019 Free Software Foundation, Inc. +! This file is part of the GNU C Library. +! +! The GNU C Library is free software; you can redistribute it and/or +! modify it under the terms of the GNU Lesser General Public +! License as published by the Free Software Foundation; either +! version 2.1 of the License, or (at your option) any later version. +! +! The GNU C Library is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +! Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with the GNU C Library; if not, see +! . + +! No SIMD math functions are available for this platform. diff --git a/math/Makefile b/math/Makefile index 76e8edac19..fc4191089d 100644 --- a/math/Makefile +++ b/math/Makefile @@ -26,6 +26,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h \ fpu_control.h complex.h bits/cmathcalls.h fenv.h \ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \ bits/math-finite.h bits/math-vector.h \ + bits/math-vector-fortran.h \ bits/libm-simd-decl-stubs.h bits/iscanonical.h \ bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \ bits/long-double.h bits/mathcalls-helper-functions.h \ diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/bits/math-vector-fortran.h new file mode 100644 index 0000000000..36051cc73e --- /dev/null +++ b/sysdeps/x86/fpu/bits/math-vector-fortran.h @@ -0,0 +1,43 @@ +! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*- +! Copyright (C) 2019 Free Software Foundation, Inc. +! This file is part of the GNU C Library. +! +! The GNU C Library is free software; you can redistribute it and/or +! modify it under the terms of the GNU Lesser General Public +! License as published by the Free Software Foundation; either +! version 2.1 of the License, or (at your option) any later version. +! +! The GNU C Library is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +! Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with the GNU C Library; if not, see +! . + +!GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (log) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64') + +!GCC$ builtin (cos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (log) attributes simd (notinbranch) if('x32') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x32') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x32') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x32') -- 2.20.1