public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
@ 2023-10-27 14:05 andrew.carlotti at arm dot com
  2023-11-04  5:37 ` [Bug target/112108] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: andrew.carlotti at arm dot com @ 2023-10-27 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112108
           Summary: [aarch64] Some intrinsics are not correctly enabled
                    when using 'target' attributes
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrew.carlotti at arm dot com
  Target Milestone: ---

Intrinsics gated by the +memtag, +ls64 and +tme features are currently only
available if the feature was enabled in the global target settings. Their
availability needs to be adjusted for individual functions, taking into account
any local changes to the enabled features (e.g. using 'target' attributes).

I'll post patches to fix this shortly.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
@ 2023-11-04  5:37 ` pinskia at gcc dot gnu.org
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-04  5:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid, wrong-code
                 CC|                            |pinskia at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-11-04
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
One example is:
```
#include <arm_acle.h>

#pragma GCC push_options
#pragma GCC target ("+nothing+memtag")

void *f(void *ptr, unsigned long long mask)
{
  return __arm_mte_create_random_tag(ptr, mask);
}

#pragma GCC pop_options
```
Currently this fails with C++ due to __builtin_aarch64_memtag_irg not being
defined.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
  2023-11-04  5:37 ` [Bug target/112108] " pinskia at gcc dot gnu.org
@ 2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-19 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Carlotti <acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:32afbb604b4958e78428006b10b3ca5e9ccd49f5

commit r15-3023-g32afbb604b4958e78428006b10b3ca5e9ccd49f5
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Oct 26 15:43:44 2023 +0100

    aarch64: Fix tme intrinsic availability

    The availability of tme intrinsics was previously gated at both
    initialisation time (using global target options) and usage time
    (accounting for function-specific target options).  This patch removes
    the check at initialisation time, and also moves the intrinsics out of
    the header file to allow for better error messages (matching the
    existing error messages for SVE intrinsics).

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc (aarch64_init_tme_builtins):
            Define intrinsic names directly.
            (aarch64_general_init_builtins): Move tme initialisation...
            (handle_arm_acle_h): ...to here, and remove feature check.
            (aarch64_general_check_builtin_call): Check tme intrinsics.
            * config/aarch64/arm_acle.h (__tstart, __tcommit, __tcancel)
            (__ttest): Remove.
            (_TMFAILURE_*): Define unconditionally.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/tme_guard-1.c: New test.
            * gcc.target/aarch64/acle/tme_guard-2.c: New test.
            * gcc.target/aarch64/acle/tme_guard-3.c: New test.
            * gcc.target/aarch64/acle/tme_guard-4.c: New test.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
  2023-11-04  5:37 ` [Bug target/112108] " pinskia at gcc dot gnu.org
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
@ 2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-19 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Carlotti <acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:4e1b617b35631df4dd6089d4044aa19d0c1adea7

commit r15-3024-g4e1b617b35631df4dd6089d4044aa19d0c1adea7
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Tue Jul 18 20:09:38 2023 +0100

    aarch64: Fix memtag intrinsic availability

    The availability of memtag intrinsics and data types were determined
    solely by the globally specified architecture features, which did not
    reflect any changes specified in target pragmas or attributes.

    This patch removes the initialisation-time guards for the intrinsics,
    and replaces them with checks at use time. It also removes the macro
    indirection from the header file - this simplifies the header, and
    allows the missing extension error reporting to find the user-facing
    intrinsic names.

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc
(aarch64_init_memtag_builtins):
            Define intrinsic names directly.
            (aarch64_general_init_builtins): Move memtag intialisation...
            (handle_arm_acle_h): ...to here, and remove feature check.
            (aarch64_general_check_builtin_call): Check memtag intrinsics.
            * config/aarch64/arm_acle.h (__arm_mte_create_random_tag)
            (__arm_mte_exclude_tag, __arm_mte_ptrdiff)
            (__arm_mte_increment_tag, __arm_mte_set_tag, __arm_mte_get_tag):
            Remove.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/memtag_guard-1.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-2.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-3.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-4.c: New test.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
                   ` (2 preceding siblings ...)
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
@ 2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-19 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Carlotti <acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:fceecc511d4918e2b27a0609f8885ec8aba8723d

commit r15-3025-gfceecc511d4918e2b27a0609f8885ec8aba8723d
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Oct 26 15:45:15 2023 +0100

    aarch64: Fix ls64 intrinsic availability

    The availability of ls64 intrinsics and data types were determined
    solely by the globally specified architecture features, which did not
    reflect any changes specified in target pragmas or attributes.

    This patch removes the initialisation-time guards for the intrinsics,
    and replaces them with checks at use time. We also get better error
    messages when ls64 is not available (matching the existing error
    messages for SVE intrinsics).

    The data512_t type is made always available; this is consistent with the
    present behaviour for Neon fp16/bf16 types.

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc (handle_arm_acle_h): Remove
            feature check at initialisation.
            (aarch64_general_check_builtin_call): Check ls64 intrinsics.
            * config/aarch64/arm_acle.h: (data512_t) Make always available.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/ls64_guard-1.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-2.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-3.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-4.c: New test.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
                   ` (3 preceding siblings ...)
  2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
@ 2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-09-04 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Andrew Carlotti
<acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:0a3a0d4a5e32e9b914b5c5cc283ee485adc6cd11

commit r14-10633-g0a3a0d4a5e32e9b914b5c5cc283ee485adc6cd11
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Oct 26 15:43:44 2023 +0100

    aarch64: Fix tme intrinsic availability

    The availability of tme intrinsics was previously gated at both
    initialisation time (using global target options) and usage time
    (accounting for function-specific target options).  This patch removes
    the check at initialisation time, and also moves the intrinsics out of
    the header file to allow for better error messages (matching the
    existing error messages for SVE intrinsics).

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc (aarch64_init_tme_builtins):
            Define intrinsic names directly.
            (aarch64_general_init_builtins): Move tme initialisation...
            (handle_arm_acle_h): ...to here, and remove feature check.
            (aarch64_general_check_builtin_call): Check tme intrinsics.
            * config/aarch64/arm_acle.h (__tstart, __tcommit, __tcancel)
            (__ttest): Remove.
            (_TMFAILURE_*): Define unconditionally.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/tme_guard-1.c: New test.
            * gcc.target/aarch64/acle/tme_guard-2.c: New test.
            * gcc.target/aarch64/acle/tme_guard-3.c: New test.
            * gcc.target/aarch64/acle/tme_guard-4.c: New test.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
                   ` (4 preceding siblings ...)
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
@ 2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-09-04 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Andrew Carlotti
<acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:8485606056ed3ca0d0acf6e0d943975e9173e7cd

commit r14-10634-g8485606056ed3ca0d0acf6e0d943975e9173e7cd
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Tue Jul 18 20:09:38 2023 +0100

    aarch64: Fix memtag intrinsic availability

    The availability of memtag intrinsics and data types were determined
    solely by the globally specified architecture features, which did not
    reflect any changes specified in target pragmas or attributes.

    This patch removes the initialisation-time guards for the intrinsics,
    and replaces them with checks at use time. It also removes the macro
    indirection from the header file - this simplifies the header, and
    allows the missing extension error reporting to find the user-facing
    intrinsic names.

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc
(aarch64_init_memtag_builtins):
            Define intrinsic names directly.
            (aarch64_general_init_builtins): Move memtag intialisation...
            (handle_arm_acle_h): ...to here, and remove feature check.
            (aarch64_general_check_builtin_call): Check memtag intrinsics.
            * config/aarch64/arm_acle.h (__arm_mte_create_random_tag)
            (__arm_mte_exclude_tag, __arm_mte_ptrdiff)
            (__arm_mte_increment_tag, __arm_mte_set_tag, __arm_mte_get_tag):
            Remove.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/memtag_guard-1.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-2.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-3.c: New test.
            * gcc.target/aarch64/acle/memtag_guard-4.c: New test.

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

* [Bug target/112108] [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes
  2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
                   ` (5 preceding siblings ...)
  2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
@ 2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-09-04 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Andrew Carlotti
<acarlotti@gcc.gnu.org>:

https://gcc.gnu.org/g:9899be7d5380c732b56ba155d4a9e192a2c483b1

commit r14-10635-g9899be7d5380c732b56ba155d4a9e192a2c483b1
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Oct 26 15:45:15 2023 +0100

    aarch64: Fix ls64 intrinsic availability

    The availability of ls64 intrinsics and data types were determined
    solely by the globally specified architecture features, which did not
    reflect any changes specified in target pragmas or attributes.

    This patch removes the initialisation-time guards for the intrinsics,
    and replaces them with checks at use time. We also get better error
    messages when ls64 is not available (matching the existing error
    messages for SVE intrinsics).

    The data512_t type is made always available; this is consistent with the
    present behaviour for Neon fp16/bf16 types.

    gcc/ChangeLog:

            PR target/112108
            * config/aarch64/aarch64-builtins.cc (handle_arm_acle_h): Remove
            feature check at initialisation.
            (aarch64_general_check_builtin_call): Check ls64 intrinsics.
            * config/aarch64/arm_acle.h: (data512_t) Make always available.

    gcc/testsuite/ChangeLog:

            PR target/112108
            * gcc.target/aarch64/acle/ls64_guard-1.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-2.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-3.c: New test.
            * gcc.target/aarch64/acle/ls64_guard-4.c: New test.

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

end of thread, other threads:[~2024-09-04 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27 14:05 [Bug target/112108] New: [aarch64] Some intrinsics are not correctly enabled when using 'target' attributes andrew.carlotti at arm dot com
2023-11-04  5:37 ` [Bug target/112108] " pinskia at gcc dot gnu.org
2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
2024-08-19 14:50 ` cvs-commit at gcc dot gnu.org
2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org
2024-09-04 18:27 ` cvs-commit at gcc dot gnu.org

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