"Philipp's TODO list" Z80 port improvement - Philipp's TODO list

From SDCC wiki
Jump to: navigation, search

This is an attempt to improve sdcc. The main goal is to improve the generated code: Decreasing code size, improving speed of the generated code. The bugs introduced while doing so should be fixed as well as existing bugs. Some important features should be added (this overlaps with the main goal as many feature requests are about code generation improvements).

The next major steps would be:

  • Implement all features necessary to use sdcc in z88dk (the most important features, such as --reserve-regs-iy, --no-optsdcc-in-asm and __smallc are there)
  • Have a look at high-level optimizations. E.g. current loop invariant optimizations are very bad huffman_iterative(), x = a + b followed by y = a + c should be changed to x = a + b followed by y = x + (c - b) for constant c and dying a to reduce register pressure.
  • Convert subtractions to additions at a higher level, since code generation is much more optimized for addition (and so is the Z80).
  • Have a look at comparison functions, in some cases the additional flag checks introduced for correctness maybe could be omitted or shortened when one of the operand valus is known at compile time.
  • Data flow analysis, this should result in substancial improvements, since many programmers still e.g. use int for loop counters where a unit_fast8_t would do; this would help legacy code that does not use bool or with comparisons as well.
  • Create a procedurally abstracting linker.
  • Move common calculations out of the individual branches. At which level should this be done (asm, iCode, etc)?
  • Replace constants by rematerializeable variables, to allow the optimal allocator to handle them.
  • Add permutations near branches.
  • Allow permutations in bitwise operations.
  • Add support for named address spaces (work in progress, current stage: Theoretical computer science research and prototype implementation). A prototype can be found in a branch.
  • Improve allocation of variables on the stack (work in progress, current stage: Theoretical computer science research and prototype implementation). A prototype can be found in a branch.
  • ez80 port.

The code size comparison and history has been moved to z80 code size.

Philipp

P.S.: More information on the new register allocator can be found at http://pholia.tdi.informatik.uni-frankfurt.de/~philipp/publications/Register.shtml.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox