How to write shift and add pattern?
Ian Lance Taylor
iant@google.com
Mon Nov 9 15:26:00 GMT 2009
Mohamed Shafi <shafitvm@gmail.com> writes:
> Ok the constrain for address register is 'a'. Thats typo in the
> pattern that i given here. The proper pattern is
>
> (define_insn "*saddl"
> [(set (match_operand:SI 0 "register_operand" "=a,d")
> (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "a,d")
> (match_operand:SI 2 "const24_operand" "J,J"))
> (match_operand:SI 3 "register_operand" "0,0")))]
>
> So how can i choose the address registers over data registers if that
> is more profitable?
If it is cheaper to move two values from data registers to address
registers than it is to use two data registers for this instruction,
then you should omit the d,d,J alternative.
If it is cheaper to move one value from a data register to an address
register than it is to use two data registers for this instruction,
then you should use !, as in "=a,!d".
Otherwise you should use ?, as in "=a,?d". You can additional ?'s for
additional tuning if appropriate.
Ian
More information about the Gcc
mailing list