[Bug tree-optimization/89007] [SVE] Implement generic vector average expansion
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 3 07:35:34 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89007
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:
https://gcc.gnu.org/g:765ef64246da4b65ca394b29095cbf891006977d
commit r17-3888-g765ef64246da4b65ca394b29095cbf891006977d
Author: liuhongt <hongtao.liu@intel.com>
Date: Tue Sep 1 01:48:29 2026 -0700
vect: Allow signed types in average fallback [PR89007]
The average fallback is restricted to unsigned types, but it also works for
signed types. Arithmetic right shifts round down, and the low-bit carry
adjusts the result in the same way.
Remove the unsigned restriction. Use target_supports_op_p rather than
optab_for_tree_code to check whether the fallback operations are available.
gcc/ChangeLog:
PR tree-optimization/89007
* tree-vect-patterns.cc (vect_recog_average_pattern): Allow signed
types in the fallback. Check whether the fallback operations are
supported.
gcc/testsuite/ChangeLog:
PR tree-optimization/89007
* gcc.target/i386/pr89007.c: New test.
More information about the Gcc-bugs
mailing list