2009/11/6 Richard Henderson <r...@redhat.com>: > On 11/06/2009 05:29 AM, Mohamed Shafi wrote: >> >> The target that i am working on has 1& 2 bit shift-add patterns. >> GCC is not generating shift-add patterns when the shift count is 1. It >> is currently generating add operations. What should be done to >> generate shift-add pattern instead of add-add pattern? > > I'm not sure. You may have to resort to matching > > (set (match_operand 0 "register_operand" "") > (plus (plus (match_operand 1 "register_operand" "") > (match_dup 1)) > (match_operand 2 "register_operand" "")))) > > But you should debug make_compound_operation first to > figure out what's going on for your port, because it's > working for x86_64: > > long foo(long a, long b) { return a*2 + b; } > > leaq (%rsi,%rdi,2), %rax # 8 *lea_2_rex64 > ret # 26 return_internal > > > r~ >
I have fixed this. The culprit was the cost factor. I added the case in targetm.rtx_costs and now it works properly. But i am having issues with the reload. Regards, Shafi