public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran
@ 2020-07-02 12:17 bule1 at huawei dot com
  2020-07-02 13:28 ` [Bug fortran/96030] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bule1 at huawei dot com @ 2020-07-02 12:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96030

            Bug ID: 96030
           Summary: AArch64: Add an option to control 64bits simdclone of
                    math functions for fortran
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bule1 at huawei dot com
  Target Milestone: ---
            Target: AARCH64

Created attachment 48824
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48824&action=edit
patch for the problem

Hi,

I found that currently fortran can only enable simdclone of math functions by
declare "!GCC$ builtin (exp) attributes simd" derivative. This kind of
declaration seems cannot indicate whether the simdlen is 64bits or 128bits. By
reading the source code and some tests, I believe the simdclone of both mode
will be generated with a single derivative declaration. At present, vector math
lib for aarch64  (mathlib and sleef) donot support the 64bits mode functions.
So when I want to enable the simd math on some application, if the application
has an oppotunity for 64bits mode simdclone, there is no matching math library
call, which leads to a link time error. 

For now, to solve this problem, I added a new backend option -msimdmath-64 to
control the generation of the 64bits mode simdclone, which is default to
disable. The patch is attached.

I think it is reasonable to set a switch to control the generation of the
64bits mode simdclone. Do we have something alike already? 

If not, is this the right way to go?

Thanks.

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

* [Bug fortran/96030] AArch64: Add an option to control 64bits simdclone of math functions for fortran
  2020-07-02 12:17 [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran bule1 at huawei dot com
@ 2020-07-02 13:28 ` jakub at gcc dot gnu.org
  2020-07-03  3:00 ` bule1 at huawei dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-07-02 13:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96030

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The directive should be doing what
#pragma omp declare simd
does on the target and it is an ABI decision what exactly it does.

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

* [Bug fortran/96030] AArch64: Add an option to control 64bits simdclone of math functions for fortran
  2020-07-02 12:17 [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran bule1 at huawei dot com
  2020-07-02 13:28 ` [Bug fortran/96030] " jakub at gcc dot gnu.org
@ 2020-07-03  3:00 ` bule1 at huawei dot com
  2020-07-07 11:31 ` bule1 at huawei dot com
  2020-07-08  9:59 ` [Bug target/96030] " dominiq at lps dot ens.fr
  3 siblings, 0 replies; 5+ messages in thread
From: bule1 at huawei dot com @ 2020-07-03  3:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96030

--- Comment #2 from Bu Le <bule1 at huawei dot com> ---
(In reply to Jakub Jelinek from comment #1)
> The directive should be doing what
> #pragma omp declare simd
> does on the target and it is an ABI decision what exactly it does.

I tried this test case. But I haven't found a way to prevent V2SF 64 bits
simdclone (e.g. _ZGVnN2v_cosf )from being generated.

!GCC$ builtin (cosf) attributes simd (notinbranch)

subroutine test_cos(a_cos, b_cos, is_cos, ie_cos)
  integer, intent(in) :: is_cos, ie_cos
  REAL(4), dimension(is_cos:ie_cos), intent(inout) :: a_cos, b_cos
  do i = 1, 3
      b_cos(i) = cos(a_cos(i))
  enddo

end subroutine test_cos


Are you suggesting we already have a way to prevent the generation of
_ZGVnN2v_cosf with !GCC$ builtin derivative? Or We haven' solve the problem
yet, but the correct way to solve this problem is to implement more feature for
the !GCC$ builtin derivative?

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

* [Bug fortran/96030] AArch64: Add an option to control 64bits simdclone of math functions for fortran
  2020-07-02 12:17 [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran bule1 at huawei dot com
  2020-07-02 13:28 ` [Bug fortran/96030] " jakub at gcc dot gnu.org
  2020-07-03  3:00 ` bule1 at huawei dot com
@ 2020-07-07 11:31 ` bule1 at huawei dot com
  2020-07-08  9:59 ` [Bug target/96030] " dominiq at lps dot ens.fr
  3 siblings, 0 replies; 5+ messages in thread
From: bule1 at huawei dot com @ 2020-07-07 11:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96030

--- Comment #3 from Bu Le <bule1 at huawei dot com> ---
(In reply to Jakub Jelinek from comment #1)
> The directive should be doing what
> #pragma omp declare simd
> does on the target and it is an ABI decision what exactly it does.

Hi,I am still confused about your comment. Would you mind explain more?

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

* [Bug target/96030] AArch64: Add an option to control 64bits simdclone of math functions for fortran
  2020-07-02 12:17 [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran bule1 at huawei dot com
                   ` (2 preceding siblings ...)
  2020-07-07 11:31 ` bule1 at huawei dot com
@ 2020-07-08  9:59 ` dominiq at lps dot ens.fr
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-07-08  9:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96030

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |target

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Target specific and has very little to do with fortran.

s/provide/provided/

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

end of thread, other threads:[~2020-07-08  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 12:17 [Bug fortran/96030] New: AArch64: Add an option to control 64bits simdclone of math functions for fortran bule1 at huawei dot com
2020-07-02 13:28 ` [Bug fortran/96030] " jakub at gcc dot gnu.org
2020-07-03  3:00 ` bule1 at huawei dot com
2020-07-07 11:31 ` bule1 at huawei dot com
2020-07-08  9:59 ` [Bug target/96030] " dominiq at lps dot ens.fr

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