2009/10/12 Paolo Bonzini <bonz...@gnu.org>: > >>> 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 >
It sounds good point. I will try it first I would like to accepted only register and force all const_int operand into register first. Obviously, this may generate low efficiency code compared with your solution. I still can't get a clear mind with step3. I may need take a while to think about it. I am a newcomer. :) Thanks for your guys advice. Best wishes. daniel.