}
(if (wi::eq_p (trunc_max, int_cst_1) && wi::eq_p (max, int_cst_2)))))))
+(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
+ /* SAT_VAL = (-(T)(X < 0) ^ MAX) */
+ (match (signed_integer_sat_val @0)
+ (bit_xor:c (nop_convert? (negate
+ (nop_convert? (convert (lt @0 integer_zerop)))))
+ max_value)))
+
(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
(match (signed_integer_sat_add @0 @1)
/* T SUM = (T)((UT)X + (UT)Y)
(nop_convert @1))))
(bit_not (bit_xor:c @0 @1)))
integer_zerop)
- (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value)
+ (signed_integer_sat_val @0)
@2))
(match (signed_integer_sat_add @0 @1)
/* T SUM = (T)((UT)X + (UT)Y)
(nop_convert @1))))
integer_zerop)
(ge (bit_xor:c @0 @1) integer_zerop))
- (bit_xor:c (nop_convert (negate (nop_convert (convert
- (lt @0 integer_zerop)))))
- max_value)
+ (signed_integer_sat_val @0)
@2))
(match (signed_integer_sat_add @0 @1)
/* SUM = .ADD_OVERFLOW (X, Y)
SAT_S_ADD = IMAGPART_EXPR (SUM) != 0 ? (-(T)(X < 0) ^ MAX) : SUM */
(cond^ (ne (imagpart (IFN_ADD_OVERFLOW:c@2 @0 @1)) integer_zerop)
- (bit_xor:c (nop_convert?
- (negate (nop_convert? (convert (lt @0 integer_zerop)))))
- max_value)
+ (signed_integer_sat_val @0)
(realpart @2)))
(match (signed_integer_sat_add @0 @1)
/* T SUM = (T)((UT)X + (UT)Y)
(nop_convert @1))))
integer_zerop)
(bit_not (lt (bit_xor:c @0 @1) integer_zerop)))
- (bit_xor:c (nop_convert (negate (nop_convert (convert
- (lt @0 integer_zerop)))))
- max_value)
+ (signed_integer_sat_val @0)
@2))
(match (signed_integer_sat_add @0 @1)
/* T SUM = (T)((UT)X + (UT)IMM);
(cond^ (lt (bit_and:c (bit_xor:c @0 (nop_convert@2 (plus (nop_convert @0)
INTEGER_CST@1)))
(bit_xor:c @0 INTEGER_CST@3)) integer_zerop)
- (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value)
+ (signed_integer_sat_val @0)
@2)
- (if (wi::bit_and (wi::to_wide (@1), wi::to_wide (@3)) == 0)))
-)
+ (if (wi::bit_and (wi::to_wide (@1), wi::to_wide (@3)) == 0))))
(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
(match (signed_integer_sat_sub @0 @1)
(bit_xor @0 (nop_convert@2 (minus (nop_convert @0)
(nop_convert @1)))))
integer_zerop)
- (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value)
+ (signed_integer_sat_val @0)
@2))
(match (signed_integer_sat_sub @0 @1)
/* T Z = (T)((UT)X - (UT)Y);
(nop_convert @1)))))
integer_zerop)
@2
- (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value)))
+ (signed_integer_sat_val @0)))
(match (signed_integer_sat_sub @0 @1)
/* T Z = (T)((UT)X - (UT)Y);
SAT_S_SUB = (X ^ Y) < 0 & (X ^ Z) < 0 ? (-(T)(X < 0) ^ MAX) : Z */
(nop_convert @1))))
integer_zerop)
(lt (bit_xor:c @0 @1) integer_zerop))
- (bit_xor:c (nop_convert (negate (nop_convert (convert
- (lt @0 integer_zerop)))))
- max_value)
+ (signed_integer_sat_val @0)
@2))
(match (signed_integer_sat_sub @0 @1)
/* Z = .SUB_OVERFLOW (X, Y)
SAT_S_SUB = IMAGPART (Z) != 0 ? (-(T)(X < 0) ^ MAX) : REALPART (Z) */
(cond^ (ne (imagpart (IFN_SUB_OVERFLOW@2 @0 @1)) integer_zerop)
- (bit_xor:c (nop_convert?
- (negate (nop_convert? (convert (lt @0 integer_zerop)))))
- max_value)
+ (signed_integer_sat_val @0)
(realpart @2))
(if (types_match (type, @0, @1)))))