mbox series

[0/2] aarch64: Use standard names for saturating arithmetic

Message ID 20241018151219.308512-1-Akram.Ahmad@arm.com
Headers show
Series aarch64: Use standard names for saturating arithmetic | expand

Message

Akram Ahmad Oct. 18, 2024, 3:12 p.m. UTC
Hi all,

This patch series introduces standard names for scalar, Adv. SIMD, and
SVE saturating arithmetic instructions in the aarch64 backend.

Additional tests are added for unsigned saturating arithmetic, as well
as to test that the auto-vectorizer correctly inserts NEON instructions
or scalar instructions where necessary, such as in 32 and 64-bit scalar
unsigned arithmetic. There are also tests for the auto-vectorized SVE
code.

An important discussion point: this patch causes scalar 32 and 64-bit
unsigned saturating arithmetic to now use adds, csinv / subs, csel as
is expected elsewhere in the backend. This affects the NEON intrinsics
for these two modes as well. This is the cause of a few test failures,
otherwise there are no regressions on aarch64-none-linux-gnu.

SVE currently uses the unpredicated version of the instruction in the
backend.

Many thanks,

Akram

---

Akram Ahmad (2):
  aarch64: Use standard names for saturating arithmetic
  aarch64: Use standard names for SVE saturating arithmetic

 gcc/config/aarch64/aarch64-builtins.cc        | 13 +++
 gcc/config/aarch64/aarch64-simd-builtins.def  |  8 +-
 gcc/config/aarch64/aarch64-simd.md            | 93 +++++++++++++++++-
 gcc/config/aarch64/aarch64-sve.md             |  4 +-
 gcc/config/aarch64/arm_neon.h                 | 96 +++++++++----------
 gcc/config/aarch64/iterators.md               |  4 +
 .../saturating_arithmetic_autovect.inc        | 58 +++++++++++
 .../saturating_arithmetic_autovect_1.c        | 79 +++++++++++++++
 .../saturating_arithmetic_autovect_2.c        | 79 +++++++++++++++
 .../saturating_arithmetic_autovect_3.c        | 75 +++++++++++++++
 .../saturating_arithmetic_autovect_4.c        | 77 +++++++++++++++
 .../aarch64/saturating_arithmetic.inc         | 39 ++++++++
 .../aarch64/saturating_arithmetic_1.c         | 41 ++++++++
 .../aarch64/saturating_arithmetic_2.c         | 41 ++++++++
 .../aarch64/saturating_arithmetic_3.c         | 30 ++++++
 .../aarch64/saturating_arithmetic_4.c         | 30 ++++++
 .../aarch64/sve/saturating_arithmetic.inc     | 68 +++++++++++++
 .../aarch64/sve/saturating_arithmetic_1.c     | 60 ++++++++++++
 .../aarch64/sve/saturating_arithmetic_2.c     | 60 ++++++++++++
 .../aarch64/sve/saturating_arithmetic_3.c     | 62 ++++++++++++
 .../aarch64/sve/saturating_arithmetic_4.c     | 62 ++++++++++++
 21 files changed, 1021 insertions(+), 58 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc
 create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/saturating_arithmetic.inc
 create mode 100644 gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_1.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_2.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_3.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_4.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/saturating_arithmetic.inc
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/saturating_arithmetic_1.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/saturating_arithmetic_2.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/saturating_arithmetic_3.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/saturating_arithmetic_4.c