That exactly is the problem.  You can't have a CONST_INT inside a
ZERO_EXTEND.  That is not valid.
You'll need a separate pattern to recognize the CONST_INT without a
ZERO_EXTEND around it.  Unfortunately, this will not give reload
the freedom it should have.



You mean I should remove the const_int (by predicator) in umulhisi3 pattern?
I mean if I remove it,  how to deal with the "reg = const_int * reg"
in umulhisi3 pattern.

You follow these steps:

1) rename the existing pattern to something else than umulhisi3, and make it only accept register_operands

2) create another insn that matches (mult (zero_extend (match_operand "register_operand") (const_int))

3) create a define_expand that checks for a CONST_INT and does not wrap it (but wraps REGs and SUBREGs and if applicable MEMs).

This is in general how you deal with too-forgiving predicates during expansion.

Paolo

Reply via email to