https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127689
--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> ---
So the other pattern is:
```
/* Transform likes of (char) ABS_EXPR <(int) x> into (char) ABSU_EXPR <x>
ABSU_EXPR returns unsigned absolute value of the operand and the operand
of the ABSU_EXPR will have the corresponding signed type. */
(simplify (abs (convert @0))
(if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0))
&& !TYPE_UNSIGNED (TREE_TYPE (@0))
&& element_precision (type) > element_precision (TREE_TYPE (@0))
&& (!VECTOR_TYPE_P (type)
|| target_supports_op_p (TREE_TYPE (@0), ABSU_EXPR, optab_vector)))
(with { tree utype = unsigned_type_for (TREE_TYPE (@0)); }
(convert (absu:utype @0)))))
```
So the pattern added in r17-2276 (for FP) should have a similar constraints.
Especially for the vector side of things. Note the check for unsigned in the
above pattern does not matter because abs of an unsigned is always removed; abs
is different from negate expr (which is the same as ~a + 1 for unsigned) in
that it is a conditional expression really. ABS will be removed due to
non-negative checks in a different abs pattern.