diff options
author | Saurabh Jha <saurabh.jha@arm.com> | 2024-08-07 12:34:20 +0100 |
---|---|---|
committer | Saurabh Jha <saurabh.jha@arm.com> | 2024-09-23 17:26:49 +0100 |
commit | c1fb78fb03caede01b02a1ebb3275ac98343d468 (patch) | |
tree | 92befae6a21d398909ede405d3e1da700af47443 /libobjc/exception.c | |
parent | bfefed6c5bb62648cf0303d377c06cb45ab1f24a (diff) | |
download | gcc-c1fb78fb03caede01b02a1ebb3275ac98343d468.zip gcc-c1fb78fb03caede01b02a1ebb3275ac98343d468.tar.gz gcc-c1fb78fb03caede01b02a1ebb3275ac98343d468.tar.bz2 |
aarch64: Add codegen support for AdvSIMD faminmax
The AArch64 FEAT_FAMINMAX extension 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 patch adds code generation support for famax and famin in terms of
existing RTL operators.
famax/famin is equivalent to first taking abs of the operands and then
taking smax/smin on the results of abs.
famax/famin (a, b) = smax/smin (abs (a), abs (b))
This fusion of operators is only possible when -march=armv9-a+faminmax
flags are passed. We also need to pass -ffast-math flag; if we don't,
then a statement like
c[i] = __builtin_fmaxf16 (a[i], b[i]);
is RTL expanded to UNSPEC_FMAXNM instead of smax (likewise for smin).
This code generation is only available on -O2 or -O3 as that is when
auto-vectorization is enabled.
gcc/ChangeLog:
* config/aarch64/aarch64-simd.md
(*aarch64_faminmax_fused): Instruction pattern for faminmax
codegen.
* config/aarch64/iterators.md: Attribute for faminmax codegen.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/simd/faminmax-codegen-no-flag.c: New test.
* gcc.target/aarch64/simd/faminmax-codegen.c: New test.
* gcc.target/aarch64/simd/faminmax-no-codegen.c: New test.
Diffstat (limited to 'libobjc/exception.c')
0 files changed, 0 insertions, 0 deletions