@@ -3086,36 +3086,39 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|| POINTER_TYPE_P (itype))
&& wi::eq_p (wi::to_wide (int_cst), wi::max_value (itype))))))
-/* SAT_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
- SAT_ADD = REALPART_EXPR <.ADD_OVERFLOW> | (IMAGPART_EXPR <.ADD_OVERFLOW> != 0) */
+/* SAT_U_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = REALPART_EXPR (SUM) | (IMAGPART_EXPR (SUM) != 0) */
(match (usadd_left_part_2 @0 @1)
(realpart (IFN_ADD_OVERFLOW:c @0 @1))
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
&& types_match (type, @0, @1))))
-/* SAT_ADD = (X + Y) | usadd_right_part_1, aka:
- SAT_ADD = (X + Y) | -((type)(X + Y) < X) */
+/* SAT_U_ADD = (X + Y) | usadd_right_part_1, aka:
+ SAT_U_ADD = (X + Y) | -((type)(X + Y) < X) */
(match (usadd_right_part_1 @0 @1)
(negate (convert (lt (plus:c @0 @1) @0)))
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
&& types_match (type, @0, @1))))
-/* SAT_ADD = usadd_left_part_1 | usadd_right_part_1, aka:
- SAT_ADD = (X + Y) | -(X > (X + Y)) */
+/* SAT_U_ADD = usadd_left_part_1 | usadd_right_part_1, aka:
+ SAT_U_ADD = (X + Y) | -(X > (X + Y)) */
(match (usadd_right_part_1 @0 @1)
(negate (convert (gt @0 (plus:c @0 @1))))
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
&& types_match (type, @0, @1))))
-/* SAT_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
- SAT_ADD = REALPART_EXPR <.ADD_OVERFLOW> | (IMAGPART_EXPR <.ADD_OVERFLOW> != 0) */
+/* SAT_U_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = REALPART_EXPR (SUM) | (IMAGPART_EXPR (SUM) != 0) */
(match (usadd_right_part_2 @0 @1)
(negate (convert (ne (imagpart (IFN_ADD_OVERFLOW:c @0 @1)) integer_zerop)))
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
&& types_match (type, @0, @1))))
-/* SAT_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
- SAT_ADD = REALPART_EXPR <.ADD_OVERFLOW> | -IMAGPART_EXPR <.ADD_OVERFLOW> */
+/* SAT_U_ADD = usadd_left_part_2 | usadd_right_part_2, aka:
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = REALPART_EXPR (SUM) | -IMAGPART_EXPR (SUM) */
(match (usadd_right_part_2 @0 @1)
(negate (imagpart (IFN_ADD_OVERFLOW:c @0 @1)))
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type)
@@ -3133,8 +3136,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(bit_ior:c (plus:c @0 @1) (usadd_right_part_1 @0 @1)))
/* Unsigned saturation add, case 2 (branchless with .ADD_OVERFLOW):
- SAT_ADD = REALPART_EXPR <.ADD_OVERFLOW> | -IMAGPART_EXPR <.ADD_OVERFLOW> or
- SAT_ADD = REALPART_EXPR <.ADD_OVERFLOW> | (IMAGPART_EXPR <.ADD_OVERFLOW> != 0) */
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = REALPART_EXPR (SUM) | -IMAGPART_EXPR (SUM) or
+ SAT_U_ADD = REALPART_EXPR (SUM) | (IMAGPART_EXPR (SUM) != 0). */
(match (unsigned_integer_sat_add @0 @1)
(bit_ior:c (usadd_left_part_2 @0 @1) (usadd_right_part_2 @0 @1)))
@@ -3159,13 +3163,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(bit_ior (plus@2 @0 @1) (negate (convert (lt @2 @0)))))))
/* Unsigned saturation add, case 5 (branch with eq .ADD_OVERFLOW):
- SAT_U_ADD = REALPART_EXPR <.ADD_OVERFLOW> == 0 ? .ADD_OVERFLOW : -1. */
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = IMAGPART_EXPR (SUM) == 0 ? REALPART_EXPR (SUM) : -1. */
(match (unsigned_integer_sat_add @0 @1)
(cond^ (eq (imagpart (IFN_ADD_OVERFLOW:c @0 @1)) integer_zerop)
(usadd_left_part_2 @0 @1) integer_minus_onep))
/* Unsigned saturation add, case 6 (branch with ne .ADD_OVERFLOW):
- SAT_U_ADD = REALPART_EXPR <.ADD_OVERFLOW> != 0 ? -1 : .ADD_OVERFLOW. */
+ SUM = ADD_OVERFLOW (X, Y)
+ SAT_U_ADD = IMAGPART_EXPR (SUM) != 0 ? -1 : REALPART_EXPR (SUM). */
(match (unsigned_integer_sat_add @0 @1)
(cond^ (ne (imagpart (IFN_ADD_OVERFLOW:c @0 @1)) integer_zerop)
integer_minus_onep (usadd_left_part_2 @0 @1)))
@@ -3187,7 +3193,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(if (wi::eq_p (max, sum))))))
/* Unsigned saturation add, case 10 (one op is imm):
- SAT_U_ADD = __builtin_add_overflow (X, 3, &ret) == 0 ? ret : -1. */
+ SUM = ADD_OVERFLOW (X, IMM)
+ SAT_U_ADD = IMAGPART_EXPR (SUM) == 0 ? REALPART_EXPR (SUM) : -1. */
(match (unsigned_integer_sat_add @0 @1)
(cond^ (ne (imagpart (IFN_ADD_OVERFLOW@2 @0 INTEGER_CST@1)) integer_zerop)
integer_minus_onep (realpart @2))