]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Add support for unpacked SVE FP comparisons
authorSpencer Abson <spencer.abson@arm.com>
Mon, 16 Jun 2025 16:54:04 +0000 (16:54 +0000)
committerSpencer Abson <spencer.abson@arm.com>
Mon, 7 Jul 2025 09:51:30 +0000 (09:51 +0000)
commit559ddecabef9c23210c84fdb05fceaf9cee81bd9
tree03334392157e003b8bacb89eafe5358ff41d1d50
parentec54a14239b12d03c600c14f3ce9710e65cd33f1
aarch64: Add support for unpacked SVE FP comparisons

This patch extends our vec_cmp expander to support partial FP modes.

We use a predicate mode that is narrower the operation's VPRED to govern
unpacked FP operations under flag_trapping_math, so the expansion must
handle cases where the comparison's target and governing predicates have
different modes.

While such predicates enable all of the defined part of the operation, they
are not all-true.  Their false bits contribute to the (trapping) behavior of
the operation, so we cannot have SVE_KNOWN_PTRUE.

gcc/ChangeLog:

* config/aarch64/aarch64-sve.md (vec_cmp<mode><vpred>): Extend
to handle partial FP modes.
(@aarch64_pred_fcm<cmp_op><mode>): Likewise.
(@aarch64_pred_fcmuo<mode>): Likewise.
(*one_cmpl<mode>3): Rename to...
(@aarch64_pred_one_cmpl<mode>_z): ... this.
* config/aarch64/aarch64.cc (aarch64_emit_sve_fp_cond): Allow the
target and governing predicates to have different modes.
(aarch64_emit_sve_or_fp_conds): Likewise.
(aarch64_emit_sve_invert_fp_cond): Likewise.
(aarch64_expand_sve_vec_cmp_float): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/unpacked_fcm_1.c: New test.
* gcc.target/aarch64/sve/unpacked_fcm_2.c: Likewise.
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/aarch64.cc
gcc/testsuite/gcc.target/aarch64/sve/unpacked_fcm_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/unpacked_fcm_2.c [new file with mode: 0644]