Why do you use the cast to unsigned int? That inserts a new intermediate operand.
Maarten > On Tue, Mar 30, 2010 at 4:28 PM, Sébastien Lorquet > <squa...@gmail.com>wrote: > >> Hi, >> >> Aren't the (shortValue&0xFF) and (shortValue>>8) optimized ? I think >> they >> are, at least for pic16. >> >> > Yes they are optimized.(not shift a bit 8 times) But see the assembly > code: > ======================================== 488 ; eeprom.c:21: > IAP_ADDRH = (unsigned int)src >> 8;^M > > 489 mov ar0,r5 > > 490 mov ar1,r6 > > 491 mov _IAP_ADDRH,r1 > > 492 ; eeprom.c:22: IAP_ADDRL = (unsigned int)src & 0x00FF;^M > > 493 mov r1,#0x00 > > 494 mov _IAP_ADDRL,r0 > ========================================It use the unnecessary r1 register > and even clear it... > > -- > Cheers, > Grissiom > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev_______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user