]> git.ipfire.org Git - thirdparty/gcc.git/commit
Match: Refactor the signed SAT_* match for saturated value [NFC]
authorPan Li <pan2.li@intel.com>
Thu, 12 Dec 2024 02:48:08 +0000 (10:48 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 7 Jan 2025 23:35:43 +0000 (07:35 +0800)
commitcfe45ab382488313d8635ccaac970a11891a2c8c
treec4ae57902859d52284f9d3c7681a8c6fd86fd310
parentd20e9b7b5a4dd99f0486d2b0a946208a9563e196
Match: Refactor the signed SAT_* match for saturated value [NFC]

This patch would like to refactor the all signed SAT_* patterns for
the saturated value.  Aka, overflow to INT_MAX when > 0 and downflow
to INT_MIN when < 0.  Thus, we can remove sorts of duplicated expression
in different patterns.

The below test suites are passed for this patch.
* The rv64gcv fully regression test.
* The x86 bootstrap test.
* The x86 fully regression test.

gcc/ChangeLog:

* match.pd: Extract saturated value match for signed SAT_*.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/match.pd