How to write shift and add pattern?

Ian Lance Taylor iant@google.com
Fri Nov 6 15:34:00 GMT 2009


Mohamed Shafi <shafitvm@gmail.com> writes:

> It is generating with data registers. Here is the pattern that i have
> written:
>
>
> (define_insn "*saddl"
>   [(set (match_operand:SI 0 "register_operand" "=r,d")
> 	(plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r,d")
> 			  (match_operand:SI 2 "const24_operand" "J,J"))
> 		 (match_operand:SI 3 "register_operand" "0,0")))]
>
> How can i do this. Will the constraint modifiers '?' or '!' help?
> How can make GCC generate shift and add sequence when the shift count is 1?

Does 'd' represent a data register?  I assume that 'r' is a general
register, as it always is.  What is the constraint character for an
address register?  You don't seem to have an alternative here for
address registers, so I'm not surprised that the compiler isn't
picking it.  No doubt I misunderstand something.

Ian



More information about the Gcc mailing list