gnu/gcc/765ef64246da4b65ca394b29095cbf891006977d 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.
2 files changed