unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add new Fortran vector math header file.
@ 2019-02-18 14:31 Martin Liška
  2019-02-18 17:55 ` Joseph Myers
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-18 14:31 UTC (permalink / raw)
  To: libc-alpha; +Cc: Joseph Myers

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Hi.

The patch adds support for Fortran vector math routines as added
into GCC 9.  The header files will be installed to the same
folder as math-vector.h.

Thanks,
Martin

ChangeLog:

2019-02-18  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Install math-vector-fortran.h.
	* sysdeps/x86/fpu/bits/math-vector-fortran.h: New file.
---
 math/Makefile                              |  1 +
 sysdeps/x86/fpu/bits/math-vector-fortran.h | 43 ++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 sysdeps/x86/fpu/bits/math-vector-fortran.h



[-- Attachment #2: 0001-Add-new-Fortran-vector-math-header-file.patch --]
[-- Type: text/x-patch, Size: 3210 bytes --]

diff --git a/math/Makefile b/math/Makefile
index 76e8edac19..fcaa2dbe9c 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..f2d5e57085
--- /dev/null
+++ b/sysdeps/x86/fpu/bits/math-vector-fortran.h
@@ -0,0 +1,43 @@
+! Platform-specific Fortran SIMD declarations of math functions.
+!   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
+!   <http://www.gnu.org/licenses/>.  */
+
+!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')


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-18 14:31 [PATCH] Add new Fortran vector math header file Martin Liška
@ 2019-02-18 17:55 ` Joseph Myers
  2019-02-19  9:18   ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Joseph Myers @ 2019-02-18 17:55 UTC (permalink / raw)
  To: Martin Liška; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

On Mon, 18 Feb 2019, Martin Liška wrote:

> Hi.
> 
> The patch adds support for Fortran vector math routines as added
> into GCC 9.  The header files will be installed to the same
> folder as math-vector.h.
> 
> Thanks,
> Martin
> 
> ChangeLog:
> 
> 2019-02-18  Martin Liska  <mliska@suse.cz>
> 
> 	* math/Makefile: Install math-vector-fortran.h.
> 	* sysdeps/x86/fpu/bits/math-vector-fortran.h: New file.

If a header is installed for all architectures, it also needs to exist for 
all architectures (presumably by having a dummy top-level 
bits/math-vector-fortran.h for use on other architectures, like the 
bits/math-vector.h there).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-18 17:55 ` Joseph Myers
@ 2019-02-19  9:18   ` Martin Liška
  2019-02-19 17:59     ` Joseph Myers
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-19  9:18 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On 2/18/19 6:55 PM, Joseph Myers wrote:
> On Mon, 18 Feb 2019, Martin Liška wrote:
> 
>> Hi.
>>
>> The patch adds support for Fortran vector math routines as added
>> into GCC 9.  The header files will be installed to the same
>> folder as math-vector.h.
>>
>> Thanks,
>> Martin
>>
>> ChangeLog:
>>
>> 2019-02-18  Martin Liska  <mliska@suse.cz>
>>
>> 	* math/Makefile: Install math-vector-fortran.h.
>> 	* sysdeps/x86/fpu/bits/math-vector-fortran.h: New file.
> 
> If a header is installed for all architectures, it also needs to exist for 
> all architectures (presumably by having a dummy top-level 
> bits/math-vector-fortran.h for use on other architectures, like the 
> bits/math-vector.h there).
> 

Sure, fixed in attached patch.

Thanks,
Martin

[-- Attachment #2: 0001-Add-new-Fortran-vector-math-header-file.patch --]
[-- Type: text/x-patch, Size: 5064 bytes --]

From 754e636c9feca886367e24b5ac1eb5416868add7 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 18 Feb 2019 15:24:12 +0100
Subject: [PATCH] Add new Fortran vector math header file.

ChangeLog:

2019-02-18  Martin Liska  <mliska@suse.cz>

	* 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..d34239ac5f
--- /dev/null
+++ b/bits/math-vector-fortran.h
@@ -0,0 +1,19 @@
+! Platform-specific Fortran SIMD declarations of math functions.
+!   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
+!   <http://www.gnu.org/licenses/>.  */
+
+! Get default empty builtin definitiones.
diff --git a/math/Makefile b/math/Makefile
index 76e8edac19..fcaa2dbe9c 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..f2d5e57085
--- /dev/null
+++ b/sysdeps/x86/fpu/bits/math-vector-fortran.h
@@ -0,0 +1,43 @@
+! Platform-specific Fortran SIMD declarations of math functions.
+!   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
+!   <http://www.gnu.org/licenses/>.  */
+
+!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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-19  9:18   ` Martin Liška
@ 2019-02-19 17:59     ` Joseph Myers
  2019-02-19 19:14       ` Zack Weinberg
  0 siblings, 1 reply; 26+ messages in thread
From: Joseph Myers @ 2019-02-19 17:59 UTC (permalink / raw)
  To: Martin Liška; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

On Tue, 19 Feb 2019, Martin Liška wrote:

> Sure, fixed in attached patch.

This version is OK with the indentation in math/Makefile fixed to match 
the surrounding lines, presuming x86_64 and x32 are indeed mutually 
exclusive conditions for the purpose of this multilib selection.

*But* there could be potential interactions with Zack's patch 
<https://sourceware.org/ml/libc-alpha/2019-02/msg00446.html> to tokenize 
installed headers to check for obsolete typedefs, since that of course is 
tokenizing headers as C and this is adding a Fortran header to the 
installed headers.  (The existing check-installed-headers tests skip 
bits/* so wouldn't be affected.)  So maybe we should have a way to 
distinguish Fortran headers, or maybe no problems arise in practice from 
tokenizing this one as C and the new Python test could change to skip such 
headers (it already has checks for particular header names that shouldn't 
be checked) if they cause problems in future.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-19 17:59     ` Joseph Myers
@ 2019-02-19 19:14       ` Zack Weinberg
  2019-02-20  9:43         ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Zack Weinberg @ 2019-02-19 19:14 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Martin Liška, GNU C Library

On Tue, Feb 19, 2019 at 12:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
> *But* there could be potential interactions with Zack's patch
> <https://sourceware.org/ml/libc-alpha/2019-02/msg00446.html> to tokenize
> installed headers to check for obsolete typedefs, since that of course is
> tokenizing headers as C and this is adding a Fortran header to the
> installed headers.

Good catch, I hadn't been paying attention to this discussion.  The
proposed math-vector-fortran.h is indeed a problem for the test
program in my patch, because of the use of $, which is not part of the
C basic source character set.  (If I remember correctly, GCC allows $
in identifiers as an extension to C, but my test program is
intentionally very picky.)

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.

Incidentally, this looks like a copy-and-paste error:

+!   You should have received a copy of the GNU Lesser General Public
+!   License along with the GNU C Library; if not, see
+!   <http://www.gnu.org/licenses/>.  */

Should that last line have a */ on it?

zw

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-19 19:14       ` Zack Weinberg
@ 2019-02-20  9:43         ` Martin Liška
  2019-02-20 13:05           ` Zack Weinberg
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-20  9:43 UTC (permalink / raw)
  To: Zack Weinberg, Joseph Myers; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On 2/19/19 8:14 PM, Zack Weinberg wrote:
> On Tue, Feb 19, 2019 at 12:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>> *But* there could be potential interactions with Zack's patch
>> <https://sourceware.org/ml/libc-alpha/2019-02/msg00446.html> to tokenize
>> installed headers to check for obsolete typedefs, since that of course is
>> tokenizing headers as C and this is adding a Fortran header to the
>> installed headers.
> 
> Good catch, I hadn't been paying attention to this discussion.  The
> proposed math-vector-fortran.h is indeed a problem for the test
> program in my patch, because of the use of $, which is not part of the
> C basic source character set.  (If I remember correctly, GCC allows $
> in identifiers as an extension to C, but my test program is
> intentionally very picky.)
> 
> 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?

> 
> Incidentally, this looks like a copy-and-paste error:
> 
> +!   You should have received a copy of the GNU Lesser General Public
> +!   License along with the GNU C Library; if not, see
> +!   <http://www.gnu.org/licenses/>.  */
> 
> Should that last line have a */ on it?

No, copy&paste error :)

Thanks,
Martin

> 
> zw
> 


[-- Attachment #2: 0001-Add-new-Fortran-vector-math-header-file.patch --]
[-- Type: text/x-patch, Size: 5087 bytes --]

From 832c91489f828948d1a827918b9d59e51a80262f Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 18 Feb 2019 15:24:12 +0100
Subject: [PATCH] Add new Fortran vector math header file.

ChangeLog:

2019-02-18  Martin Liska  <mliska@suse.cz>

	* 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                 | 20 ++++++++++
 math/Makefile                              |  1 +
 sysdeps/x86/fpu/bits/math-vector-fortran.h | 44 ++++++++++++++++++++++
 3 files changed, 65 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..ab0a060329
--- /dev/null
+++ b/bits/math-vector-fortran.h
@@ -0,0 +1,20 @@
+! -*- f90 -*-
+! Platform-specific Fortran SIMD declarations of math functions.
+!   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
+!   <http://www.gnu.org/licenses/>.
+
+! Get default empty builtin definitiones.
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..7b634c36a3
--- /dev/null
+++ b/sysdeps/x86/fpu/bits/math-vector-fortran.h
@@ -0,0 +1,44 @@
+! -*- f90 -*-
+! Platform-specific Fortran SIMD declarations of math functions.
+!   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
+!   <http://www.gnu.org/licenses/>.
+
+!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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-20  9:43         ` Martin Liška
@ 2019-02-20 13:05           ` Zack Weinberg
  2019-02-20 13:52             ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Zack Weinberg @ 2019-02-20 13:05 UTC (permalink / raw)
  To: Martin Liška; +Cc: Joseph Myers, GNU C Library

On Wed, Feb 20, 2019 at 4:43 AM Martin Liška <mliska@suse.cz> 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Add new Fortran vector math header file.
  2019-02-20 13:05           ` Zack Weinberg
@ 2019-02-20 13:52             ` Martin Liška
  2019-02-26 17:56               ` [PATCH] Fix location where math-vector-fortran.h is installed Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-20 13:52 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

On 2/20/19 2:05 PM, Zack Weinberg wrote:
> On Wed, Feb 20, 2019 at 4:43 AM Martin Liška <mliska@suse.cz> 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

[-- Attachment #2: 0001-Add-new-Fortran-vector-math-header-file.patch --]
[-- Type: text/x-patch, Size: 5105 bytes --]

From 4c3b0fd3da9ed3c6d69892cce37206e6f3405bc4 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 18 Feb 2019 15:24:12 +0100
Subject: [PATCH] Add new Fortran vector math header file.

ChangeLog:

2019-02-18  Martin Liska  <mliska@suse.cz>

	* 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
+!   <http://www.gnu.org/licenses/>.
+
+! 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
+!   <http://www.gnu.org/licenses/>.
+
+!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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-20 13:52             ` Martin Liška
@ 2019-02-26 17:56               ` Martin Liška
  2019-02-26 18:05                 ` Joseph Myers
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-26 17:56 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

Hi.

This is follow up patch where I fix location where the header
is installed. I made a type as I was copying & pasting.

I also built glibc package in openSUSE and verified a recent GCC
can properly find the header.

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 1929 bytes --]

From ccc30d7ac8ae5383e3e876bbd0da88640aefd4a0 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
---
 {bits => finclude}/math-vector-fortran.h                 | 0
 math/Makefile                                            | 2 +-
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {bits => finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/bits/math-vector-fortran.h b/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to finclude/math-vector-fortran.h
diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-26 17:56               ` [PATCH] Fix location where math-vector-fortran.h is installed Martin Liška
@ 2019-02-26 18:05                 ` Joseph Myers
  2019-02-26 18:30                   ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Joseph Myers @ 2019-02-26 18:05 UTC (permalink / raw)
  To: Martin Liška; +Cc: Zack Weinberg, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

On Tue, 26 Feb 2019, Martin Liška wrote:

> Hi.
> 
> This is follow up patch where I fix location where the header
> is installed. I made a type as I was copying & pasting.

It's not clear to me that we want to add a top-level finclude/ directory 
in the glibc source tree.  Would math/finclude/ work just as well as a 
source tree location for this file?

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-26 18:05                 ` Joseph Myers
@ 2019-02-26 18:30                   ` Martin Liška
  2019-02-26 21:16                     ` Florian Weimer
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-26 18:30 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Zack Weinberg, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

On 2/26/19 7:05 PM, Joseph Myers wrote:
> On Tue, 26 Feb 2019, Martin Liška wrote:
> 
>> Hi.
>>
>> This is follow up patch where I fix location where the header
>> is installed. I made a type as I was copying & pasting.
> 
> It's not clear to me that we want to add a top-level finclude/ directory 
> in the glibc source tree.  Would math/finclude/ work just as well as a 
> source tree location for this file?
> 

Yes, I can confirm math/finclude work as well.

May I install the patch?
Martin

[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 1944 bytes --]

From cb267faade1b6558e895b496294cd8783236be3f Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 0
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {bits => math/finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-26 18:30                   ` Martin Liška
@ 2019-02-26 21:16                     ` Florian Weimer
  2019-02-26 21:41                       ` Zack Weinberg
  0 siblings, 1 reply; 26+ messages in thread
From: Florian Weimer @ 2019-02-26 21:16 UTC (permalink / raw)
  To: Martin Liška; +Cc: Joseph Myers, Zack Weinberg, GNU C Library

* Martin Liška:

> On 2/26/19 7:05 PM, Joseph Myers wrote:
>> On Tue, 26 Feb 2019, Martin Liška wrote:
>> 
>>> Hi.
>>>
>>> This is follow up patch where I fix location where the header
>>> is installed. I made a type as I was copying & pasting.
>> 
>> It's not clear to me that we want to add a top-level finclude/ directory 
>> in the glibc source tree.  Would math/finclude/ work just as well as a 
>> source tree location for this file?
>> 
>
> Yes, I can confirm math/finclude work as well.
>
> May I install the patch?

This causes test suite failures for me:

math/check-installed-headers-c.out:

In file included from /tmp/cih_test_C67G81.c:8:
../sysdeps/x86/fpu/finclude/math-vector-fortran.h:1:1: error: expected identifie
r or ‘(’ before ‘!’ token
 ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*
-
 ^

math/check-wrapper-headers.out:

error: missing wrapper header include/finclude/math-vector-fortran.h for math/finclude/math-vector-fortran.h

I think we need to whitelist this in multiple places.  It is unfortunate
that Fortran headers use .h like C headers.

Is the finclude/ prefix standardized?

Thanks,
Florian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-26 21:16                     ` Florian Weimer
@ 2019-02-26 21:41                       ` Zack Weinberg
  2019-02-27  8:09                         ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Zack Weinberg @ 2019-02-26 21:41 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Martin Liška, Joseph Myers, GNU C Library

On Tue, Feb 26, 2019 at 4:16 PM Florian Weimer <fweimer@redhat.com> wrote:
> * Martin Liška:
> > On 2/26/19 7:05 PM, Joseph Myers wrote:
> >> On Tue, 26 Feb 2019, Martin Liška wrote:
> >>
> >>> Hi.
> >>>
> >>> This is follow up patch where I fix location where the header
> >>> is installed. I made a type as I was copying & pasting.

Do I understand correctly that the desired installation location is
$(prefix)/include/finclude/math-vector-fortran.h ?

> This causes test suite failures for me:
>
> math/check-installed-headers-c.out:
>
> In file included from /tmp/cih_test_C67G81.c:8:
> ../sysdeps/x86/fpu/finclude/math-vector-fortran.h:1:1: error: expected identifie
> r or ‘(’ before ‘!’ token
>  ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*

Moving the file out of bits/ caused it to be newly subject to these tests.

If $(prefix)/include/finclude/ is intended to contain nothing but
Fortran headers, we could add finclude to the list of subdirectories
to skip in scripts/check*headers* ...

zw

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-26 21:41                       ` Zack Weinberg
@ 2019-02-27  8:09                         ` Martin Liška
  2019-02-27 10:12                           ` Florian Weimer
                                             ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Martin Liška @ 2019-02-27  8:09 UTC (permalink / raw)
  To: Zack Weinberg, Florian Weimer; +Cc: Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

On 2/26/19 10:41 PM, Zack Weinberg wrote:
> On Tue, Feb 26, 2019 at 4:16 PM Florian Weimer <fweimer@redhat.com> wrote:
>> * Martin Liška:
>>> On 2/26/19 7:05 PM, Joseph Myers wrote:
>>>> On Tue, 26 Feb 2019, Martin Liška wrote:
>>>>
>>>>> Hi.
>>>>>
>>>>> This is follow up patch where I fix location where the header
>>>>> is installed. I made a type as I was copying & pasting.
> 
> Do I understand correctly that the desired installation location is
> $(prefix)/include/finclude/math-vector-fortran.h ?

Yes.

> 
>> This causes test suite failures for me:
>>
>> math/check-installed-headers-c.out:
>>
>> In file included from /tmp/cih_test_C67G81.c:8:
>> ../sysdeps/x86/fpu/finclude/math-vector-fortran.h:1:1: error: expected identifie
>> r or ‘(’ before ‘!’ token
>>  ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*

I skipped that header explicitly.

> 
> Moving the file out of bits/ caused it to be newly subject to these tests.
> 
> If $(prefix)/include/finclude/ is intended to contain nothing but
> Fortran headers, we could add finclude to the list of subdirectories
> to skip in scripts/check*headers* ...
> 
> zw
> 

And for the check-wrapper-headers.py, I read a header file and skip files
with 'f90' file type.

Updated patch is attached.

Martin


[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 3342 bytes --]

From 597b7ec78b23f8bd76a4d8acfeaee265f06f2a1b Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
	* scripts/check-installed-headers.sh: Skip Fortran header file.
	* scripts/check-wrapper-headers.py: Filter out f90 files.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 0
 scripts/check-installed-headers.sh                       | 4 ++++
 scripts/check-wrapper-headers.py                         | 4 ++++
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 5 files changed, 9 insertions(+), 1 deletion(-)
 rename {bits => math/finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..937ed969ec 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
         (sys/elf.h)
             continue;;
 
+        # Skip Fortran header
+        (finclude/math-vector-fortran.h)
+            continue;;
+
 	# sys/sysctl.h is unsupported for x32.
 	(sys/sysctl.h)
             case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..5c982c3eb4 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,10 @@ def check_headers(args):
 
         is_nonsysdep_header = os.access(header, os.R_OK)
         if is_nonsysdep_header:
+            # Skip Fortran header files
+            if '-*- f90 -*-' in open(header).readlines()[0]:
+                continue
+
             include_path = os.path.join(args.root, INCLUDE, header)
             if not os.access(include_path, os.R_OK):
                 print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27  8:09                         ` Martin Liška
@ 2019-02-27 10:12                           ` Florian Weimer
  2019-02-27 10:36                             ` Martin Liška
  2019-02-27 11:30                           ` Andreas Schwab
  2019-02-27 15:00                           ` Zack Weinberg
  2 siblings, 1 reply; 26+ messages in thread
From: Florian Weimer @ 2019-02-27 10:12 UTC (permalink / raw)
  To: Martin Liška; +Cc: Zack Weinberg, Joseph Myers, GNU C Library

* Martin Liška:

>          is_nonsysdep_header = os.access(header, os.R_OK)
>          if is_nonsysdep_header:
> +            # Skip Fortran header files
> +            if '-*- f90 -*-' in open(header).readlines()[0]:
> +                continue

Please use “with” to close the file promptly, and do not read the entire
file, like this (untested):

    # Skip Fortran header files.
    with open(header) as inp:
        if '-*- f90 -*-' in next(inp):
            continue

Thanks,
Florian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27 10:12                           ` Florian Weimer
@ 2019-02-27 10:36                             ` Martin Liška
  0 siblings, 0 replies; 26+ messages in thread
From: Martin Liška @ 2019-02-27 10:36 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Zack Weinberg, Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

On 2/27/19 11:12 AM, Florian Weimer wrote:
> * Martin Liška:
> 
>>          is_nonsysdep_header = os.access(header, os.R_OK)
>>          if is_nonsysdep_header:
>> +            # Skip Fortran header files
>> +            if '-*- f90 -*-' in open(header).readlines()[0]:
>> +                continue
> 
> Please use “with” to close the file promptly, and do not read the entire
> file, like this (untested):
> 
>     # Skip Fortran header files.
>     with open(header) as inp:
>         if '-*- f90 -*-' in next(inp):
>             continue

Good point. Is the patch ready to be installed now?

Thanks,
Martin

> 
> Thanks,
> Florian
> 


[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 3373 bytes --]

From 5e786337c48dbf33453a634725e2e95b10c73b62 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
	* scripts/check-installed-headers.sh: Skip Fortran header file.
	* scripts/check-wrapper-headers.py: Filter out f90 files.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 0
 scripts/check-installed-headers.sh                       | 4 ++++
 scripts/check-wrapper-headers.py                         | 5 +++++
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 5 files changed, 10 insertions(+), 1 deletion(-)
 rename {bits => math/finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..937ed969ec 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
         (sys/elf.h)
             continue;;
 
+        # Skip Fortran header
+        (finclude/math-vector-fortran.h)
+            continue;;
+
 	# sys/sysctl.h is unsupported for x32.
 	(sys/sysctl.h)
             case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..6d9a89bc98 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,11 @@ def check_headers(args):
 
         is_nonsysdep_header = os.access(header, os.R_OK)
         if is_nonsysdep_header:
+            # Skip Fortran header files
+            with open(header) as inp:
+                if '-*- f90 -*-' in next(inp):
+                    continue
+
             include_path = os.path.join(args.root, INCLUDE, header)
             if not os.access(include_path, os.R_OK):
                 print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27  8:09                         ` Martin Liška
  2019-02-27 10:12                           ` Florian Weimer
@ 2019-02-27 11:30                           ` Andreas Schwab
  2019-02-27 11:53                             ` Martin Liška
  2019-02-27 15:00                           ` Zack Weinberg
  2 siblings, 1 reply; 26+ messages in thread
From: Andreas Schwab @ 2019-02-27 11:30 UTC (permalink / raw)
  To: Martin Liška; +Cc: Florian Weimer, Joseph Myers, GNU C Library

On Feb 27 2019, Martin Liška <mliska@suse.cz> wrote:

> 2019-02-26  Martin Liska  <mliska@suse.cz>
>
> 	* math/Makefile: Change location where math-vector-fortran.h is
> 	installed.
> 	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.

That file resides in math/.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27 11:30                           ` Andreas Schwab
@ 2019-02-27 11:53                             ` Martin Liška
  0 siblings, 0 replies; 26+ messages in thread
From: Martin Liška @ 2019-02-27 11:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Florian Weimer, Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

On 2/27/19 12:30 PM, Andreas Schwab wrote:
> On Feb 27 2019, Martin Liška <mliska@suse.cz> wrote:
> 
>> 2019-02-26  Martin Liska  <mliska@suse.cz>
>>
>> 	* math/Makefile: Change location where math-vector-fortran.h is
>> 	installed.
>> 	* finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
> 
> That file resides in math/.
> 
> Andreas.
> 

Sure.

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 3378 bytes --]

From bad39d298a37b3411ccc323ffe7a94d4891fe2f0 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* math/finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
	* scripts/check-installed-headers.sh: Skip Fortran header file.
	* scripts/check-wrapper-headers.py: Filter out f90 files.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 0
 scripts/check-installed-headers.sh                       | 4 ++++
 scripts/check-wrapper-headers.py                         | 5 +++++
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 5 files changed, 10 insertions(+), 1 deletion(-)
 rename {bits => math/finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..937ed969ec 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
         (sys/elf.h)
             continue;;
 
+        # Skip Fortran header
+        (finclude/math-vector-fortran.h)
+            continue;;
+
 	# sys/sysctl.h is unsupported for x32.
 	(sys/sysctl.h)
             case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..6d9a89bc98 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,11 @@ def check_headers(args):
 
         is_nonsysdep_header = os.access(header, os.R_OK)
         if is_nonsysdep_header:
+            # Skip Fortran header files
+            with open(header) as inp:
+                if '-*- f90 -*-' in next(inp):
+                    continue
+
             include_path = os.path.join(args.root, INCLUDE, header)
             if not os.access(include_path, os.R_OK):
                 print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27  8:09                         ` Martin Liška
  2019-02-27 10:12                           ` Florian Weimer
  2019-02-27 11:30                           ` Andreas Schwab
@ 2019-02-27 15:00                           ` Zack Weinberg
  2019-02-28 13:18                             ` Martin Liška
  2 siblings, 1 reply; 26+ messages in thread
From: Zack Weinberg @ 2019-02-27 15:00 UTC (permalink / raw)
  To: Martin Liška; +Cc: Florian Weimer, Joseph Myers, GNU C Library

On Wed, Feb 27, 2019 at 3:09 AM Martin Liška <mliska@suse.cz> wrote:
> On 2/26/19 10:41 PM, Zack Weinberg wrote:
> > On Tue, Feb 26, 2019 at 4:16 PM Florian Weimer <fweimer@redhat.com> wrote:
> >> * Martin Liška:
> >>> On 2/26/19 7:05 PM, Joseph Myers wrote:
> >>>> On Tue, 26 Feb 2019, Martin Liška wrote:
> >>>>
> >>>>> Hi.
> >>>>>
> >>>>> This is follow up patch where I fix location where the header
> >>>>> is installed. I made a type as I was copying & pasting.
> >
> > Do I understand correctly that the desired installation location is
> > $(prefix)/include/finclude/math-vector-fortran.h ?
>
> Yes.

Will there ever be C headers in $(prefix)/include/finclude ?

> >> In file included from /tmp/cih_test_C67G81.c:8:
> >> ../sysdeps/x86/fpu/finclude/math-vector-fortran.h:1:1: error: expected identifie
> >> r or ‘(’ before ‘!’ token
> >>  ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*
>
> I skipped that header explicitly.
...
> +        # Skip Fortran header
> +        (finclude/math-vector-fortran.h)
> +            continue;;

To put the above question another way, is there a reason why this shouldn't be

+        # Skip Fortran headers
+        (finclude/*)
+            continue;;

?

> And for the check-wrapper-headers.py, I read a header file and skip files
> with 'f90' file type.

If you're going to do it this way, I recommend you copy the more
general Emacs modeline parser from
https://sourceware.org/ml/libc-alpha/2019-02/msg00539.html ... but if
we can just skip finclude/* that might be a better approach for both
scripts.

zw

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-27 15:00                           ` Zack Weinberg
@ 2019-02-28 13:18                             ` Martin Liška
  2019-02-28 13:30                               ` Zack Weinberg
  0 siblings, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-02-28 13:18 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Florian Weimer, Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

On 2/27/19 4:00 PM, Zack Weinberg wrote:
> On Wed, Feb 27, 2019 at 3:09 AM Martin Liška <mliska@suse.cz> wrote:
>> On 2/26/19 10:41 PM, Zack Weinberg wrote:
>>> On Tue, Feb 26, 2019 at 4:16 PM Florian Weimer <fweimer@redhat.com> wrote:
>>>> * Martin Liška:
>>>>> On 2/26/19 7:05 PM, Joseph Myers wrote:
>>>>>> On Tue, 26 Feb 2019, Martin Liška wrote:
>>>>>>
>>>>>>> Hi.
>>>>>>>
>>>>>>> This is follow up patch where I fix location where the header
>>>>>>> is installed. I made a type as I was copying & pasting.
>>>
>>> Do I understand correctly that the desired installation location is
>>> $(prefix)/include/finclude/math-vector-fortran.h ?
>>
>> Yes.
> 
> Will there ever be C headers in $(prefix)/include/finclude ?

Hello.

No, only Fortran header files.

> 
>>>> In file included from /tmp/cih_test_C67G81.c:8:
>>>> ../sysdeps/x86/fpu/finclude/math-vector-fortran.h:1:1: error: expected identifie
>>>> r or ‘(’ before ‘!’ token
>>>>  ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*
>>
>> I skipped that header explicitly.
> ...
>> +        # Skip Fortran header
>> +        (finclude/math-vector-fortran.h)
>> +            continue;;
> 
> To put the above question another way, is there a reason why this shouldn't be
> 
> +        # Skip Fortran headers
> +        (finclude/*)
> +            continue;;
> 
> ?

Yes.

> 
>> And for the check-wrapper-headers.py, I read a header file and skip files
>> with 'f90' file type.
> 
> If you're going to do it this way, I recommend you copy the more
> general Emacs modeline parser from
> https://sourceware.org/ml/libc-alpha/2019-02/msg00539.html ... but if
> we can just skip finclude/* that might be a better approach for both
> scripts.

Agree, it would be easier.

Martin

> 
> zw
> 


[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 4088 bytes --]

From b52fa57a42a335d50f03cfe4addd9d92e31851b6 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* math/finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
	* scripts/check-installed-headers.sh: Skip Fortran header files.
	* scripts/check-wrapper-headers.py: Likewise.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 2 +-
 scripts/check-installed-headers.sh                       | 4 ++++
 scripts/check-wrapper-headers.py                         | 4 ++++
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 2 +-
 5 files changed, 11 insertions(+), 3 deletions(-)
 rename {bits => math/finclude}/math-vector-fortran.h (98%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (99%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 98%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
index 7c1e095094..66d467c22d 100644
--- a/bits/math-vector-fortran.h
+++ b/math/finclude/math-vector-fortran.h
@@ -1,4 +1,4 @@
-! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
+! Platform-specific declarations of SIMD math functions for Fortran.
 !   Copyright (C) 2019 Free Software Foundation, Inc.
 !   This file is part of the GNU C Library.
 !
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..e90bdc389f 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
         (sys/elf.h)
             continue;;
 
+        # Skip Fortran headers
+        (finclude/*)
+            continue;;
+
 	# sys/sysctl.h is unsupported for x32.
 	(sys/sysctl.h)
             case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..fc3c25d7de 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,10 @@ def check_headers(args):
 
         is_nonsysdep_header = os.access(header, os.R_OK)
         if is_nonsysdep_header:
+            # Skip Fortran header files
+            if 'finclude' in header:
+                continue
+
             include_path = os.path.join(args.root, INCLUDE, header)
             if not os.access(include_path, os.R_OK):
                 print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 99%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
index 36051cc73e..4b69beed67 100644
--- a/sysdeps/x86/fpu/bits/math-vector-fortran.h
+++ b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
@@ -1,4 +1,4 @@
-! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
+! Platform-specific declarations of SIMD math functions for Fortran.
 !   Copyright (C) 2019 Free Software Foundation, Inc.
 !   This file is part of the GNU C Library.
 !
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-28 13:18                             ` Martin Liška
@ 2019-02-28 13:30                               ` Zack Weinberg
  2019-02-28 13:32                                 ` Florian Weimer
  0 siblings, 1 reply; 26+ messages in thread
From: Zack Weinberg @ 2019-02-28 13:30 UTC (permalink / raw)
  To: Martin Liška; +Cc: Florian Weimer, Joseph Myers, GNU C Library

Revised patch looks good to me except:

> -! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
> +! Platform-specific declarations of SIMD math functions for Fortran.

Let's keep the -*- f90 -*- annotations, they will also be helpful for
future people editing these files.  For instance, on my computer, both
emacs and vim use the Fortran syntax highlighting rules for these
files when the annotation is present, and the C rules when it's
absent.

> +            # Skip Fortran header files
> +            if 'finclude' in header:
> +                continue

I think this conditional should be

    if header.startswith('finclude/') or '/finclude/' in header

so that it only applies to headers in the directory 'finclude', not
any hypothetical future headers that happen to have the string
'finclude' in their base names.  (I don't know why that would happen,
but if it ever did, I can see someone being really confused why it
wasn't getting tested, so some extra defensiveness now seems like a
good idea.)

zw

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-28 13:30                               ` Zack Weinberg
@ 2019-02-28 13:32                                 ` Florian Weimer
  2019-03-01  9:31                                   ` Martin Liška
  0 siblings, 1 reply; 26+ messages in thread
From: Florian Weimer @ 2019-02-28 13:32 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Martin Liška, Joseph Myers, GNU C Library

* Zack Weinberg:

> Revised patch looks good to me except:
>
>> -! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
>> +! Platform-specific declarations of SIMD math functions for Fortran.
>
> Let's keep the -*- f90 -*- annotations, they will also be helpful for
> future people editing these files.  For instance, on my computer, both
> emacs and vim use the Fortran syntax highlighting rules for these
> files when the annotation is present, and the C rules when it's
> absent.
>
>> +            # Skip Fortran header files
>> +            if 'finclude' in header:
>> +                continue
>
> I think this conditional should be
>
>     if header.startswith('finclude/') or '/finclude/' in header
>
> so that it only applies to headers in the directory 'finclude', not
> any hypothetical future headers that happen to have the string
> 'finclude' in their base names.  (I don't know why that would happen,
> but if it ever did, I can see someone being really confused why it
> wasn't getting tested, so some extra defensiveness now seems like a
> good idea.)

I agree.  Maybe also add a period to the end of the comment. 8-)

Thanks,
Florian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-02-28 13:32                                 ` Florian Weimer
@ 2019-03-01  9:31                                   ` Martin Liška
  2019-03-01 22:30                                     ` Steve Ellcey
  2019-03-05 12:03                                     ` Martin Liška
  0 siblings, 2 replies; 26+ messages in thread
From: Martin Liška @ 2019-03-01  9:31 UTC (permalink / raw)
  To: Florian Weimer, Zack Weinberg; +Cc: Joseph Myers, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

On 2/28/19 2:32 PM, Florian Weimer wrote:
> * Zack Weinberg:
> 
>> Revised patch looks good to me except:
>>
>>> -! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*-
>>> +! Platform-specific declarations of SIMD math functions for Fortran.
>>
>> Let's keep the -*- f90 -*- annotations, they will also be helpful for
>> future people editing these files.  For instance, on my computer, both
>> emacs and vim use the Fortran syntax highlighting rules for these
>> files when the annotation is present, and the C rules when it's
>> absent.
>>
>>> +            # Skip Fortran header files
>>> +            if 'finclude' in header:
>>> +                continue
>>
>> I think this conditional should be
>>
>>     if header.startswith('finclude/') or '/finclude/' in header
>>
>> so that it only applies to headers in the directory 'finclude', not
>> any hypothetical future headers that happen to have the string
>> 'finclude' in their base names.  (I don't know why that would happen,
>> but if it ever did, I can see someone being really confused why it
>> wasn't getting tested, so some extra defensiveness now seems like a
>> good idea.)
> 
> I agree.  Maybe also add a period to the end of the comment. 8-)
> 
> Thanks,
> Florian
> 

Thank you both for help, I've updated the patch.

Martin

[-- Attachment #2: 0001-Fix-location-where-math-vector-fortran.h-is-installe.patch --]
[-- Type: text/x-patch, Size: 3297 bytes --]

From 74b9d0deddbcb0f6433be937f6b1d7f632e257d6 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 26 Feb 2019 18:17:36 +0100
Subject: [PATCH] Fix location where math-vector-fortran.h is installed.

ChangeLog:

2019-02-26  Martin Liska  <mliska@suse.cz>

	* math/Makefile: Change location where math-vector-fortran.h is
	installed.
	* math/finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h.
	* sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move
	from sysdeps/x86/fpu/bits/math-vector-fortran.h.
	* scripts/check-installed-headers.sh: Skip Fortran header files.
	* scripts/check-wrapper-headers.py: Likewise.
---
 math/Makefile                                            | 2 +-
 {bits => math/finclude}/math-vector-fortran.h            | 0
 scripts/check-installed-headers.sh                       | 4 ++++
 scripts/check-wrapper-headers.py                         | 4 ++++
 sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h | 0
 5 files changed, 9 insertions(+), 1 deletion(-)
 rename {bits => math/finclude}/math-vector-fortran.h (100%)
 rename sysdeps/x86/fpu/{bits => finclude}/math-vector-fortran.h (100%)

diff --git a/math/Makefile b/math/Makefile
index fc4191089d..cb4eaec6a9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +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 \
+		   finclude/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/bits/math-vector-fortran.h b/math/finclude/math-vector-fortran.h
similarity index 100%
rename from bits/math-vector-fortran.h
rename to math/finclude/math-vector-fortran.h
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..1f4496446c 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -84,6 +84,10 @@ for header in "$@"; do
         (sys/elf.h)
             continue;;
 
+        # Skip Fortran headers.
+        (finclude/*)
+            continue;;
+
 	# sys/sysctl.h is unsupported for x32.
 	(sys/sysctl.h)
             case "$is_x32" in
diff --git a/scripts/check-wrapper-headers.py b/scripts/check-wrapper-headers.py
index 094faa3ced..dc9fd86063 100644
--- a/scripts/check-wrapper-headers.py
+++ b/scripts/check-wrapper-headers.py
@@ -75,6 +75,10 @@ def check_headers(args):
 
         is_nonsysdep_header = os.access(header, os.R_OK)
         if is_nonsysdep_header:
+            # Skip Fortran header files.
+            if '/finclude/' in header:
+                continue
+
             include_path = os.path.join(args.root, INCLUDE, header)
             if not os.access(include_path, os.R_OK):
                 print('error: missing wrapper header {} for {}'.format(
diff --git a/sysdeps/x86/fpu/bits/math-vector-fortran.h b/sysdeps/x86/fpu/finclude/math-vector-fortran.h
similarity index 100%
rename from sysdeps/x86/fpu/bits/math-vector-fortran.h
rename to sysdeps/x86/fpu/finclude/math-vector-fortran.h
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-03-01  9:31                                   ` Martin Liška
@ 2019-03-01 22:30                                     ` Steve Ellcey
  2019-03-05 12:03                                     ` Martin Liška
  1 sibling, 0 replies; 26+ messages in thread
From: Steve Ellcey @ 2019-03-01 22:30 UTC (permalink / raw)
  To: fweimer@redhat.com, mliska@suse.cz, zackw@panix.com
  Cc: libc-alpha@sourceware.org, joseph@codesourcery.com

On Fri, 2019-03-01 at 10:31 +0100, Martin Liška wrote:
> 
> Thank you both for help, I've updated the patch.
> 
> Martin

Martin,

I tested this patch with some vector routines I am experimenting with
on Aarch64 and it worked fine for me when I created a
sysdeps/aarch64/fpu/finclude/math-vector-fortran.h file.

Steve Ellcey
sellcey@marvell.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-03-01  9:31                                   ` Martin Liška
  2019-03-01 22:30                                     ` Steve Ellcey
@ 2019-03-05 12:03                                     ` Martin Liška
  2019-03-06 21:13                                       ` Joseph Myers
  1 sibling, 1 reply; 26+ messages in thread
From: Martin Liška @ 2019-03-05 12:03 UTC (permalink / raw)
  To: Florian Weimer, Zack Weinberg; +Cc: Joseph Myers, GNU C Library

On 3/1/19 10:31 AM, Martin Liška wrote:
> Thank you both for help, I've updated the patch.

Do it look fine to be installed?

Thanks,
Martin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] Fix location where math-vector-fortran.h is installed.
  2019-03-05 12:03                                     ` Martin Liška
@ 2019-03-06 21:13                                       ` Joseph Myers
  0 siblings, 0 replies; 26+ messages in thread
From: Joseph Myers @ 2019-03-06 21:13 UTC (permalink / raw)
  To: Martin Liška; +Cc: Florian Weimer, Zack Weinberg, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

On Tue, 5 Mar 2019, Martin Liška wrote:

> On 3/1/19 10:31 AM, Martin Liška wrote:
> > Thank you both for help, I've updated the patch.
> 
> Do it look fine to be installed?

Yes.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-03-06 21:13 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 14:31 [PATCH] Add new Fortran vector math header file Martin Liška
2019-02-18 17:55 ` Joseph Myers
2019-02-19  9:18   ` Martin Liška
2019-02-19 17:59     ` Joseph Myers
2019-02-19 19:14       ` Zack Weinberg
2019-02-20  9:43         ` Martin Liška
2019-02-20 13:05           ` Zack Weinberg
2019-02-20 13:52             ` Martin Liška
2019-02-26 17:56               ` [PATCH] Fix location where math-vector-fortran.h is installed Martin Liška
2019-02-26 18:05                 ` Joseph Myers
2019-02-26 18:30                   ` Martin Liška
2019-02-26 21:16                     ` Florian Weimer
2019-02-26 21:41                       ` Zack Weinberg
2019-02-27  8:09                         ` Martin Liška
2019-02-27 10:12                           ` Florian Weimer
2019-02-27 10:36                             ` Martin Liška
2019-02-27 11:30                           ` Andreas Schwab
2019-02-27 11:53                             ` Martin Liška
2019-02-27 15:00                           ` Zack Weinberg
2019-02-28 13:18                             ` Martin Liška
2019-02-28 13:30                               ` Zack Weinberg
2019-02-28 13:32                                 ` Florian Weimer
2019-03-01  9:31                                   ` Martin Liška
2019-03-01 22:30                                     ` Steve Ellcey
2019-03-05 12:03                                     ` Martin Liška
2019-03-06 21:13                                       ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).