public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc math functions for OpenMP vectoization
@ 2020-06-05 13:58 Feltgen, Eric
  2020-06-05 14:11 ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Feltgen, Eric @ 2020-06-05 13:58 UTC (permalink / raw)
  To: gcc

Hi there,


my name is Eric, I'm a german student at RWTH Aachen University currently researching OpenMP.


For my research, I'm also looking at math functions provided by compilers like GCC. When writing vectorizable code, it is important to use math functions which also allow for vectorization. I've read that gcc includes a set of math functions which are SIMD compatible. Where can I find resources on them?


It would be awesome if you could tell me where to find documentation.


Thanks in advance, I highly appreciate your support.


Best regards,


Eric

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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 13:58 gcc math functions for OpenMP vectoization Feltgen, Eric
@ 2020-06-05 14:11 ` Jakub Jelinek
  2020-06-05 16:10   ` Tobias Burnus
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2020-06-05 14:11 UTC (permalink / raw)
  To: Feltgen, Eric; +Cc: gcc

On Fri, Jun 05, 2020 at 01:58:55PM +0000, Feltgen, Eric wrote:
> my name is Eric, I'm a german student at RWTH Aachen University currently researching OpenMP.
> 
> 
> For my research, I'm also looking at math functions provided by compilers like GCC. When writing vectorizable code, it is important to use math functions which also allow for vectorization. I've read that gcc includes a set of math functions which are SIMD compatible. Where can I find resources on them?
> 
> 
> It would be awesome if you could tell me where to find documentation.

It is glibc that provides them, not GCC.
See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD
for the header file and the functions are then implemented (mostly?) in assembly in
e.g. /usr/src/libc/sysdeps/x86_64/fpu/ directory.  There is similar support
for aarch64.
All that is provided by GCC is -fopenmp #pragma omp declare simd support
and support for corresponding simd attribute (which is what is used if
-fopenmp is not enabled).

	Jakub


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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 14:11 ` Jakub Jelinek
@ 2020-06-05 16:10   ` Tobias Burnus
  2020-06-05 17:58     ` Toon Moene
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Burnus @ 2020-06-05 16:10 UTC (permalink / raw)
  To: Jakub Jelinek, Feltgen, Eric; +Cc: gcc

On 6/5/20 4:11 PM, Jakub Jelinek via Gcc wrote:
> It is glibc that provides them, not GCC.
> See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD

Minor addition: That header file is included in math.h, i.e. automatically available.
For Fortran/gfortran there is math-vector-fortran.h (also provided by glibc)
which has the same functions and a similar effect.

Cheers,

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 16:10   ` Tobias Burnus
@ 2020-06-05 17:58     ` Toon Moene
  2020-06-05 18:31       ` Richard Biener
                         ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Toon Moene @ 2020-06-05 17:58 UTC (permalink / raw)
  To: gcc

On 6/5/20 6:10 PM, Tobias Burnus wrote:

> On 6/5/20 4:11 PM, Jakub Jelinek via Gcc wrote:

>> It is glibc that provides them, not GCC.
>> See 
>> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD 
>>
> 
> Minor addition: That header file is included in math.h, i.e. 
> automatically available.
> For Fortran/gfortran there is math-vector-fortran.h (also provided by 
> glibc)
> which has the same functions and a similar effect.

I wonder if there are Linux distributions where this actually effected 
already.

I know for sure that it is not in Debian Testing (as of two weeks ago) 
and Red Hat Fedora 30 (similarly).

Do you know of any ?

Kind regards,

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands

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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 17:58     ` Toon Moene
@ 2020-06-05 18:31       ` Richard Biener
  2020-06-05 18:34       ` Jonathan Wakely
  2020-06-06 10:01       ` Florian Weimer
  2 siblings, 0 replies; 7+ messages in thread
From: Richard Biener @ 2020-06-05 18:31 UTC (permalink / raw)
  To: gcc, Toon Moene

On June 5, 2020 7:58:20 PM GMT+02:00, Toon Moene <toon@moene.org> wrote:
>On 6/5/20 6:10 PM, Tobias Burnus wrote:
>
>> On 6/5/20 4:11 PM, Jakub Jelinek via Gcc wrote:
>
>>> It is glibc that provides them, not GCC.
>>> See 
>>>
>https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD
>
>>>
>> 
>> Minor addition: That header file is included in math.h, i.e. 
>> automatically available.
>> For Fortran/gfortran there is math-vector-fortran.h (also provided by
>
>> glibc)
>> which has the same functions and a similar effect.
>
>I wonder if there are Linux distributions where this actually effected 
>already.
>
>I know for sure that it is not in Debian Testing (as of two weeks ago) 
>and Red Hat Fedora 30 (similarly).
>
>Do you know of any ?

It works in openSUSE Tumbleweed at least.

Richard. 

>
>Kind regards,


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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 17:58     ` Toon Moene
  2020-06-05 18:31       ` Richard Biener
@ 2020-06-05 18:34       ` Jonathan Wakely
  2020-06-06 10:01       ` Florian Weimer
  2 siblings, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2020-06-05 18:34 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc

On Fri, 5 Jun 2020 at 18:59, Toon Moene <toon@moene.org> wrote:
>
> On 6/5/20 6:10 PM, Tobias Burnus wrote:
>
> > On 6/5/20 4:11 PM, Jakub Jelinek via Gcc wrote:
>
> >> It is glibc that provides them, not GCC.
> >> See
> >> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD
> >>
> >
> > Minor addition: That header file is included in math.h, i.e.
> > automatically available.
> > For Fortran/gfortran there is math-vector-fortran.h (also provided by
> > glibc)
> > which has the same functions and a similar effect.
>
> I wonder if there are Linux distributions where this actually effected
> already.
>
> I know for sure that it is not in Debian Testing (as of two weeks ago)
> and Red Hat Fedora 30 (similarly).

Fedora 30 is EOL.

> Do you know of any ?

Fedora 31 and 32.

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

* Re: gcc math functions for OpenMP vectoization
  2020-06-05 17:58     ` Toon Moene
  2020-06-05 18:31       ` Richard Biener
  2020-06-05 18:34       ` Jonathan Wakely
@ 2020-06-06 10:01       ` Florian Weimer
  2 siblings, 0 replies; 7+ messages in thread
From: Florian Weimer @ 2020-06-06 10:01 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc

* Toon Moene:

> On 6/5/20 6:10 PM, Tobias Burnus wrote:
>
>> On 6/5/20 4:11 PM, Jakub Jelinek via Gcc wrote:
>
>>> It is glibc that provides them, not GCC.
>>> See 
>>> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/math-vector.h;h=0801905da7b85e2f43fb6b682a7b84c5eec469d4;hb=HEAD 
>>>
>> 
>> Minor addition: That header file is included in math.h, i.e. 
>> automatically available.
>> For Fortran/gfortran there is math-vector-fortran.h (also provided by 
>> glibc)
>> which has the same functions and a similar effect.
>
> I wonder if there are Linux distributions where this actually effected 
> already.
>
> I know for sure that it is not in Debian Testing (as of two weeks ago) 
> and Red Hat Fedora 30 (similarly).
>
> Do you know of any ?

I think we backported the header file into Red Hat Enterprise Linux
8.2.  So CentOS 8 should have it as well.

The system compiler is too old to use it, but GCC Toolset 9 comes with
a Fortran compiler that should pick it up (but I don't use Fortran
myself).

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

end of thread, other threads:[~2020-06-06 10:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 13:58 gcc math functions for OpenMP vectoization Feltgen, Eric
2020-06-05 14:11 ` Jakub Jelinek
2020-06-05 16:10   ` Tobias Burnus
2020-06-05 17:58     ` Toon Moene
2020-06-05 18:31       ` Richard Biener
2020-06-05 18:34       ` Jonathan Wakely
2020-06-06 10:01       ` Florian Weimer

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).