From: Frieder F. <fri...@we...> - 2003-03-01 17:38:22
|
Hi, I append a patch which enables the generation of optimized increment and decrement code on variables in data space. Without the patch: 1238 ;parse.c:146: cur++; 04CC 1239 00153$: 1240 ; genPlus 1241 ; genPlusIncr 04CC 74 01 1242 mov a,#0x01 04CE 25*09 1243 add a,_cur 04D0 F5*09 1244 mov _cur,a 1245 ; Peephole 180 changed mov to clr 04D2 E4 1246 clr a 04D3 35*0A 1247 addc a,(_cur + 1) 04D5 F5*0A 1248 mov (_cur + 1),a With the patch: 1212 ;parse.c:146: cur++; 04A5 1213 00153$: 1214 ; genPlus 1215 ; genPlusIncr 04A5 05*09 1216 inc _cur 04A7 E4 1217 clr a 04A8 B5*09 02 1218 cjne a,_cur,00294$ 04AB 05*0A 1219 inc (_cur + 1) 04AD 1220 00294$: It saves about 40 bytes on the file parse.c which Johan recently posted. (42 to be more accurate - Douglas Adams greets here) The code actually doing the inc/dec was already hiding there, it was just waiting to be enabled?) Frieder |