The code generated in the z80-related ports for long and long long variables is often rather inefficient. This is very visible e.g. in the Contiki network code, which uses unsigned long in wuite a few places. A few examples:
1) Inline code for shifts of long long variables should be used instead of the support function. The call overhead is longer than the inline code would be.
2) GET_VALUE_AT_ADDRESS should use ldir when the destination is on the stack.
3) GET_VALUE_AT_ADDRESS should use ld dd, (nn) when loading from a fixed address into registers.
4) POINTER_SET should use lidr when the source is on the stack.
5) POINTER_SET should use ld (nn), dd when storing from registers to a fixed location..
Log in to post a comment.