public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
@ 2021-09-02  7:59 pinskia at gcc dot gnu.org
  2021-10-22 10:10 ` [Bug target/102171] " tnfchris at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-02  7:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102171
           Summary: vget_low_*/vget_high_* intrinsics should become
                    BIT_FIELD_REF during gimple
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 95958
  Target Milestone: ---
            Target: aarch64*-linux-gnu

#include <arm_neon.h>
float16x4_t f0(float16x8_t b)
{
  return vget_low_f16 (b);
}
float16x4_t f(float16x8_t b)
{
  return vget_high_f16 (b);
}
float16x4_t f1(float16x8_t b)
{
  return ((float16x4_t*)&b)[0];
}
float16x4_t f2(float16x8_t b)
{
  return ((float16x4_t*)&b)[1];
}
---- CUT ----
For little-endian f0 and f1 are the same, and f and f2 are the same.
For big-endian f0 and f2 are the same, and f0 and f1 are the same.

The reason why we should simplify them at the gimple level is to allow the
gimple optimizers do the work for us.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95958
[Bug 95958] [meta-bug] Inefficient arm_neon.h code for AArch64

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
@ 2021-10-22 10:10 ` tnfchris at gcc dot gnu.org
  2024-02-27  9:28 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-10-22 10:10 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-10-22

--- Comment #1 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
confirmed

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
  2021-10-22 10:10 ` [Bug target/102171] " tnfchris at gcc dot gnu.org
@ 2024-02-27  9:28 ` pinskia at gcc dot gnu.org
  2024-02-27  9:32 ` tnfchris at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-27  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think I am going to implement this (or assign it interally to someone else to
implement).

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
  2021-10-22 10:10 ` [Bug target/102171] " tnfchris at gcc dot gnu.org
  2024-02-27  9:28 ` pinskia at gcc dot gnu.org
@ 2024-02-27  9:32 ` tnfchris at gcc dot gnu.org
  2024-05-20 20:06 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-02-27  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> I think I am going to implement this (or assign it interally to someone else
> to implement).

If you do, please also remove them from arm_neon.h and use the new intrinsics
framework.

We're gradually trying to get this file empty.

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-02-27  9:32 ` tnfchris at gcc dot gnu.org
@ 2024-05-20 20:06 ` cvs-commit at gcc dot gnu.org
  2024-05-22 20:07 ` cvs-commit at gcc dot gnu.org
  2024-05-22 20:09 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-20 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r15-697-ga2e4fe5a53cf75cd055f64e745ebd51253e42254
Author: Pengxuan Zheng <quic_pzheng@quicinc.com>
Date:   Mon May 13 10:47:10 2024 -0700

    aarch64: Fold vget_low_* intrinsics to BIT_FIELD_REF [PR102171]

    This patch folds vget_low_* intrinsics to BIT_FILED_REF to open up more
    optimization opportunities for gimple optimizers.

    While we are here, we also remove the vget_low_* definitions from
arm_neon.h and
    use the new intrinsics framework.

            PR target/102171

    gcc/ChangeLog:

            * config/aarch64/aarch64-builtins.cc
(AARCH64_SIMD_VGET_LOW_BUILTINS):
            New macro to create definitions for all vget_low intrinsics.
            (VGET_LOW_BUILTIN): Likewise.
            (enum aarch64_builtins): Add vget_low function codes.
            (aarch64_general_fold_builtin): Fold vget_low calls.
            * config/aarch64/aarch64-simd-builtins.def: Delete vget_low
builtins.
            * config/aarch64/aarch64-simd.md (aarch64_get_low<mode>): Delete.
            (aarch64_vget_lo_halfv8bf): Likewise.
            * config/aarch64/arm_neon.h (__attribute__): Delete.
            (vget_low_f16): Likewise.
            (vget_low_f32): Likewise.
            (vget_low_f64): Likewise.
            (vget_low_p8): Likewise.
            (vget_low_p16): Likewise.
            (vget_low_p64): Likewise.
            (vget_low_s8): Likewise.
            (vget_low_s16): Likewise.
            (vget_low_s32): Likewise.
            (vget_low_s64): Likewise.
            (vget_low_u8): Likewise.
            (vget_low_u16): Likewise.
            (vget_low_u32): Likewise.
            (vget_low_u64): Likewise.
            (vget_low_bf16): Likewise.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/pr113573.c: Replace
__builtin_aarch64_get_lowv8hi
            with vget_low_s16.
            * gcc.target/aarch64/vget_low_2.c: New test.
            * gcc.target/aarch64/vget_low_2_be.c: New test.

    Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-20 20:06 ` cvs-commit at gcc dot gnu.org
@ 2024-05-22 20:07 ` cvs-commit at gcc dot gnu.org
  2024-05-22 20:09 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-22 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:1d1ef1c22752b3e250ee769ae6d79f537471a57f

commit r15-778-g1d1ef1c22752b3e250ee769ae6d79f537471a57f
Author: Pengxuan Zheng <quic_pzheng@quicinc.com>
Date:   Tue May 21 10:55:06 2024 -0700

    aarch64: Fold vget_high_* intrinsics to BIT_FIELD_REF [PR102171]

    This patch is a follow-up of r15-697-ga2e4fe5a53cf75 to also fold
vget_high_*
    intrinsics to BIT_FILED_REF and remove the vget_high_* definitions from
    arm_neon.h to use the new intrinsics framework.

            PR target/102171

    gcc/ChangeLog:

            * config/aarch64/aarch64-builtins.cc
(AARCH64_SIMD_VGET_HIGH_BUILTINS):
            New macro to create definitions for all vget_high intrinsics.
            (VGET_HIGH_BUILTIN): Likewise.
            (enum aarch64_builtins): Add vget_high function codes.
            (AARCH64_SIMD_VGET_LOW_BUILTINS): Delete duplicate macro.
            (aarch64_general_fold_builtin): Fold vget_high calls.
            * config/aarch64/aarch64-simd-builtins.def: Delete vget_high
builtins.
            * config/aarch64/aarch64-simd.md (aarch64_get_high<mode>): Delete.
            (aarch64_vget_hi_halfv8bf): Likewise.
            * config/aarch64/arm_neon.h (__attribute__): Delete.
            (vget_high_f16): Likewise.
            (vget_high_f32): Likewise.
            (vget_high_f64): Likewise.
            (vget_high_p8): Likewise.
            (vget_high_p16): Likewise.
            (vget_high_p64): Likewise.
            (vget_high_s8): Likewise.
            (vget_high_s16): Likewise.
            (vget_high_s32): Likewise.
            (vget_high_s64): Likewise.
            (vget_high_u8): Likewise.
            (vget_high_u16): Likewise.
            (vget_high_u32): Likewise.
            (vget_high_u64): Likewise.
            (vget_high_bf16): Likewise.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/vget_high_2.c: New test.
            * gcc.target/aarch64/vget_high_2_be.c: New test.

    Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>

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

* [Bug target/102171] vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple
  2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-22 20:07 ` cvs-commit at gcc dot gnu.org
@ 2024-05-22 20:09 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |15.0

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-05-22 20:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  7:59 [Bug target/102171] New: vget_low_*/vget_high_* intrinsics should become BIT_FIELD_REF during gimple pinskia at gcc dot gnu.org
2021-10-22 10:10 ` [Bug target/102171] " tnfchris at gcc dot gnu.org
2024-02-27  9:28 ` pinskia at gcc dot gnu.org
2024-02-27  9:32 ` tnfchris at gcc dot gnu.org
2024-05-20 20:06 ` cvs-commit at gcc dot gnu.org
2024-05-22 20:07 ` cvs-commit at gcc dot gnu.org
2024-05-22 20:09 ` pinskia 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).