It is also frequently required to obtain a higher order byte or word of a larger integral type (long, int or short types). SDCC recognizes the following expressions to yield the higher order byte or word and generates optimized code for it, e.g.:
unsigned int gint;will generate the following code:
91 ; hob.c 15Again, variations of these cases may not be recognized. They are standard C expressions, so I heartily recommend these be the only way to get the higher order byte/word, (it is portable). Of course it will be recognized even if it is embedded in other expressions, e.g.:
xyz = gint + ((gint >> 8) & 0xFF);will still be recognized.
Next: 8.1.13 Peephole Optimizer Up: 8.1 Optimizations Previous: 8.1.11 Highest Order Bit Contents Index 2008-03-13 |