From: Frieder F. <fri...@we...> - 2006-06-07 07:59:43
|
Hi, Krishnendu Chatterjee schrieb: > Please suggest me some idea, where I can get rid of this extra code. you can tweak your 2.5.0 compiler with an additional peephole rule (see option "--peep-file") like the one below (not tested). Some remarks: a) Actually this should be done above the peephole level of SDCC, so non-mcs51 ports get this without additional peepholes (and it works for mcs51 memory models other than small) Please file a feature request at: http://sourceforge.net/tracker/?group_id=599&atid=350599 b) Consider upgrading your compiler to a recent snapshot? c) You are probably aware of this but you might want to make use of memory specifiers like __xdata . -----------------8<------------------------- // see mail sdcc-devel 2006-06-07 replace{ mov a,#%1 add a,%3 mov %3,a clr a addc a,%4 mov %4,a mov a,#%2 add a,%3 mov %3,a clr a addc a,%4 mov %4,a } by { ; Peephole xxx removed double add (there should be no need for this peephole) mov a,#(%1+%2) add a,%3 mov %3,a mov a,#((%1+%2)>>8) addc a,%4 mov %4,a ; carry might differ } if notVolatile %3 %4 ----------------->8------------------------- Greetings |