mbox series

[v3,0/2] Add support for AdvSIMD faminmax

Message ID 20240807151114.36785-1-saurabh.jha@arm.com
Headers show
Series Add support for AdvSIMD faminmax | expand

Message

Saurabh Jha Aug. 7, 2024, 3:11 p.m. UTC
From: Saurabh Jha <saurabh.jha@arm.com>

This patch series is a respin of a previous patch here:
https://gcc.gnu.org/pipermail/gcc-patches/2024-August/658984.html

The AArch64 FEAT_FAMINMAX is optional from Armv9.2-a and mandatory from
Armv9.5-a. It introduces instructions for computing the floating point
absolute maximum and minimum of the two vectors element-wise.

This new version addresses all review comments from the previous version.
Additionally, we realised that the NaN/Inf behaviour of famax/famin and
fmax/fmin are not the same, as we previously thought. The behaviour of
famax/famin and fmaxnm/fminnm are not same either.

The new codegen strategy is to combine the rtl operators smax and abs
into famax and smin and abs into famin.

We are using two instruction patterns: one for intrinsics and one for
codegen.

Apart from codegen changes and their test cases, this new version also
changes intrinsic tests to use the -O3 flag. This removes the need for
testing loads and stores.

The old code for intrinsic and the refactoring of report_missing_extension
and report_missing_extension_p are same as the previous version.

Regression tested for aarch64-none-linux-gnu and found no regressions.

Ok for master? I don't have commit access so can someone please commit
on my behalf?

Saurabh Jha (2):
  aarch64: Add AdvSIMD faminmax intrinsics
  aarch64: Add codegen support for AdvSIMD faminmax

 gcc/config/aarch64/aarch64-builtins.cc        | 173 +++++++++++++-
 gcc/config/aarch64/aarch64-builtins.h         |   5 +-
 .../aarch64/aarch64-option-extensions.def     |   2 +
 gcc/config/aarch64/aarch64-simd.md            |  21 ++
 gcc/config/aarch64/aarch64-sve-builtins.cc    |  22 --
 gcc/config/aarch64/aarch64.h                  |   4 +
 gcc/config/aarch64/iterators.md               |  12 +
 gcc/config/arm/types.md                       |   6 +
 gcc/doc/invoke.texi                           |   2 +
 .../aarch64/simd/faminmax-builtins-no-flag.c  |  10 +
 .../aarch64/simd/faminmax-builtins.c          | 115 ++++++++++
 .../aarch64/simd/faminmax-codegen-no-flag.c   | 217 ++++++++++++++++++
 .../aarch64/simd/faminmax-codegen.c           | 197 ++++++++++++++++
 13 files changed, 754 insertions(+), 32 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins-no-flag.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c