&& !TYPE_UNSIGNED (TREE_TYPE (@1))
&& element_precision (@1)
<= element_precision (@0)
- && bitwise_equal_p (@1, @2))
+ && bitwise_equal_p (@1, @2)
+ && (!VECTOR_TYPE_P (type)
+ || target_supports_op_p (type, ABS_EXPR, optab_vector)))
(if (TYPE_UNSIGNED (TREE_TYPE (@2)))
(with {
tree stype = signed_type_for (TREE_TYPE (@2));
&& !TYPE_UNSIGNED (TREE_TYPE (@1))
&& element_precision (@1)
<= element_precision (@0)
- && bitwise_equal_p (@1, @2))
+ && bitwise_equal_p (@1, @2)
+ && (!VECTOR_TYPE_P (type)
+ || (target_supports_op_p (type, ABS_EXPR, optab_vector)
+ && target_supports_op_p (type, NEGATE_EXPR, optab_vector))))
(if ((ANY_INTEGRAL_TYPE_P (TREE_TYPE (@2))
&& !TYPE_OVERFLOW_WRAPS (TREE_TYPE (@2)))
|| TYPE_UNSIGNED (TREE_TYPE (@2)))
(simplify
(cnd (cmp (minus@0 @1 @2) zerop) @0 (minus @2 @1))
(if (!HONOR_SIGNED_ZEROS (type)
- && !TYPE_UNSIGNED (type))
+ && !TYPE_UNSIGNED (type)
+ && (!VECTOR_TYPE_P (type)
+ || target_supports_op_p (type, ABS_EXPR, optab_vector)))
(abs @0))))
/* (A - B) <=/< 0 ? (A - B) : (B - A) same as -abs (A - B) */
(for cmp (le lt)
(if (!HONOR_SIGNED_ZEROS (type)
&& !TYPE_UNSIGNED (type))
(if (ANY_INTEGRAL_TYPE_P (type)
- && !TYPE_OVERFLOW_WRAPS (type))
+ && !TYPE_OVERFLOW_WRAPS (type)
+ && (!VECTOR_TYPE_P (type)
+ || (target_supports_op_p (type, ABS_EXPR, optab_vector)
+ && target_supports_op_p (type, NEGATE_EXPR, optab_vector))))
(with {
tree utype = unsigned_type_for (type);
}
--- /dev/null
+/* { dg-additional-options "-fwrapv" } */
+
+int vsad8_c_y;
+char *vsad8_c_s1, *vsad8_c_s2;
+long vsad8_c_stride;
+int vsad8_c()
+{
+ int score, x;
+ for (; vsad8_c_y; vsad8_c_y++)
+ {
+ x = 0;
+ for (; x < 8; x++)
+ score += (vsad8_c_s1[x] - vsad8_c_s2[x] - vsad8_c_s1[x + vsad8_c_stride]
+ + vsad8_c_s2[x + vsad8_c_stride]) >= 0
+ ? vsad8_c_s1[x] - vsad8_c_s2[x] -
+ vsad8_c_s1[x + vsad8_c_stride] +
+ vsad8_c_s2[x + vsad8_c_stride]
+ : -(vsad8_c_s1[x] - vsad8_c_s2[x] -
+ vsad8_c_s1[x + vsad8_c_stride] +
+ vsad8_c_s2[x + vsad8_c_stride]);
+ vsad8_c_s1 += vsad8_c_stride;
+ vsad8_c_s2 += vsad8_c_stride;
+ }
+ return score;
+}