]> git.ipfire.org Git - thirdparty/gcc.git/commit
Match: Refactor bit_ior based unsigned SAT_MUL pattern by widen mul helper [NFC]
authorPan Li <pan2.li@intel.com>
Thu, 6 Nov 2025 05:19:20 +0000 (13:19 +0800)
committerPan Li <pan2.li@intel.com>
Fri, 7 Nov 2025 12:24:27 +0000 (20:24 +0800)
commit0376ac1da3d9125276c427dcb17b2d7db2cbe18f
tree96d207955d88f7ac514576391b23febb2f63167a
parentdd305514bbca46a39d020018e1bef0cfa15c99c8
Match: Refactor bit_ior 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.  Like
min based pattern, this patch focus on bit_ior based pattern.

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: Leverage usmul_widen_mult by bit_ior based
unsigned SAT_MUL pattern.

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