i386: Fix *udivmodsi4_pow2_zext_? patterns
authorUros Bizjak <ubizjak@gmail.com>
Fri, 9 Jul 2021 09:45:54 +0000 (11:45 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Fri, 9 Jul 2021 09:46:33 +0000 (11:46 +0200)
commit10722fb36de944c2385a275bb2b270727f7c93a4
tree33317708be03f0be94675c2c3490e71eb30ad6dc
parent840fabd8e0cd002c744adf219c64a672b0fa83b3
i386: Fix *udivmodsi4_pow2_zext_? patterns

In addition to the obvious cut-n-pasto where *udivmodsi4_pow2_zext_2
never matches, limit the range of the immediate operand to prevent
out of range immediate operand of AND instruction.

Found by inspection, the patterns rarely match (if at all), since
tree optimizers do the transformation before RTL is generated. But
according to the comment above *udivmod<mode>4_pow2, the constant can
materialize after expansion, so leave these patterns around for now.

2021-07-09  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
* config/i386/i386.md (*udivmodsi4_pow2_zext_1): Limit the
log2 range of operands[3] to [1,31].
(*udivmodsi4_pow2_zext_2): Ditto.  Correct insn RTX pattern.
gcc/config/i386/i386.md