diff options
author | Saurabh Jha <saurabh.jha@arm.com> | 2024-09-30 14:38:32 +0000 |
---|---|---|
committer | Saurabh Jha <saurabh.jha@arm.com> | 2024-10-11 10:36:29 +0000 |
commit | 914f4f86e6cb1e570a1928fccde1dbbfc362430b (patch) | |
tree | a5fc1f6a32e301299d5e03f4f2e21ecefba6480c /gcc/tree-vectorizer.h | |
parent | 1a6a8cb1a72b282c418cd143b132de6e67b5d62b (diff) | |
download | gcc-914f4f86e6cb1e570a1928fccde1dbbfc362430b.zip gcc-914f4f86e6cb1e570a1928fccde1dbbfc362430b.tar.gz gcc-914f4f86e6cb1e570a1928fccde1dbbfc362430b.tar.bz2 |
aarch64: Add codegen support for SVE2 faminmax
The AArch64 FEAT_FAMINMAX extension introduces instructions for
computing the floating point absolute maximum and minimum of the
two vectors element-wise.
This patch adds code generation for famax and famin in terms of existing
unspecs. With this patch:
1. famax can be expressed as taking UNSPEC_COND_SMAX of the two operands
and then taking absolute value of their result.
2. famin can be expressed as taking UNSPEC_COND_SMIN of the two operands
and then taking absolute value of their result.
This fusion of operators is only possible when
-march=armv9-a+faminmax+sve flags are passed. We also need to pass
-ffast-math flag; this is what enables compiler to use UNSPEC_COND_SMAX
and UNSPEC_COND_SMIN.
This code generation is only available on -O2 or -O3 as that is when
auto-vectorization is enabled.
gcc/ChangeLog:
* config/aarch64/aarch64-sve2.md
(*aarch64_pred_faminmax_fused): Instruction pattern for faminmax
codegen.
* config/aarch64/iterators.md: Iterator and attribute for
faminmax codegen.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/faminmax_1.c: New test.
* gcc.target/aarch64/sve/faminmax_2.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions