aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2024-12-12 10:56:35 +0800
committerPan Li <pan2.li@intel.com>2025-01-08 07:35:51 +0800
commit4435e82708872f705c47eeb63bbcdfc54b0449fc (patch)
tree47fba0a2d225a0334ee5ec6dc2a3cae95409a3ea /gcc/match.pd
parentcfe45ab382488313d8635ccaac970a11891a2c8c (diff)
downloadgcc-4435e82708872f705c47eeb63bbcdfc54b0449fc.zip
gcc-4435e82708872f705c47eeb63bbcdfc54b0449fc.tar.gz
gcc-4435e82708872f705c47eeb63bbcdfc54b0449fc.tar.bz2
Match: Update the comments for indicating SAT_* pattern
Given the SAT_* patterns are grouped for each alu and signed or not, add leading comments to indicate the beginning of the pattern. gcc/ChangeLog: * match.pd: Update comments for sat_* pattern. Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index cb48c8c..1d0c9f5 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3115,6 +3115,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|| POINTER_TYPE_P (itype))
&& wi::eq_p (wi::to_wide (int_cst), wi::max_value (itype))))))
+/* Saturation add for unsigned integer. */
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type))
(match (usadd_overflow_mask @0 @1)
/* SAT_U_ADD = (X + Y) | -(X > (X + Y)).
@@ -3189,6 +3190,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
integer_minus_onep (realpart @2))
(if (types_match (type, @0) && int_fits_type_p (@1, type)))))
+/* Saturation sub for unsigned integer. */
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type))
(match (unsigned_integer_sat_sub @0 @1)
/* SAT_U_SUB = X > Y ? X - Y : 0 */
@@ -3278,6 +3280,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
}
(if (wi::eq_p (sum, wi::uhwi (0, precision))))))))
+/* Saturation truncate for unsigned integer. */
(if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (type))
(match (unsigned_integer_sat_trunc @0)
/* SAT_U_TRUNC = (NT)x | (NT)(-(X > (WT)(NT)(-1))) */
@@ -3337,6 +3340,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(nop_convert? (convert (lt @0 integer_zerop)))))
max_value)))
+/* Saturation add for signed integer. */
(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
(match (signed_integer_sat_add @0 @1)
/* T SUM = (T)((UT)X + (UT)Y)
@@ -3391,6 +3395,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
@2)
(if (wi::bit_and (wi::to_wide (@1), wi::to_wide (@3)) == 0))))
+/* Saturation sub for signed integer. */
(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
(match (signed_integer_sat_sub @0 @1)
/* T Z = (T)((UT)X - (UT)Y);
@@ -3427,6 +3432,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(realpart @2))
(if (types_match (type, @0, @1)))))
+/* Saturation truncate for signed integer. */
(if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type))
(match (signed_integer_sat_trunc @0)
/* SAT_S_TRUNC(X) = (unsigned)X + NT_MAX + 1 > Unsigned_MAX ? (NT)X */