This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to write shift and add pattern?
- From: Ian Lance Taylor <iant at google dot com>
- To: Mohamed Shafi <shafitvm at gmail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, GCC <gcc at gcc dot gnu dot org>
- Date: Fri, 06 Nov 2009 07:33:58 -0800
- Subject: Re: How to write shift and add pattern?
- References: <ba0bd44d0908280651r676484a5r6b776a2f6d1f12b7@mail.gmail.com> <4A97E98C.8040009@redhat.com> <ba0bd44d0911060529r5f6b9a3al83a8dea954a836a5@mail.gmail.com>
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