]> git.ipfire.org Git - thirdparty/gcc.git/commit
Match: Refactor min based unsigned SAT_MUL pattern by widen mul helper [NFC]
authorPan Li <pan2.li@intel.com>
Mon, 3 Nov 2025 11:27:24 +0000 (19:27 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 4 Nov 2025 15:06:02 +0000 (23:06 +0800)
commit0834dc3a80ebffdd28e27739c0d5c0c5b1f681f9
tree08398067f28665b175692ce4128fd1cfdd379852
parent0013501e462bd362de50bbac71ea4c6c7528dc08
Match: Refactor min based unsigned SAT_MUL pattern by widen mul helper [NFC]

There are 3 kinds of widen_mul during the unsigned SAT_MUL pattern, aka
* widen_mul directly, like _3 w* _4
* convert and the widen_mul, like (uint64_t)_3 *w (uint64_t)_4
* convert and then mul, like (uint64_t)_3 * (uint64_t)_4

All of them will be referenced during different forms of unsigned
SAT_MUL pattern match, but actually we can wrap them into a helper
which present the "widening_mul" sematics.  With this helper, some
unnecessary pattern and duplicated code could be eliminated.

The below test suites are passed for this patch:
1. The rv64gcv fully regression tests.
2. The x86 bootstrap tests.
3. The x86 fully regression tests.

gcc/ChangeLog:

* match.pd: Add usmul_widen_mult helper and referenced by
min based unsigned SAT_MUL pattern.

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