|
CodeCompressor, Raisonance Post-Linker Optimization Technology
reduces the OVERALL size of your application by up to 50% (see benchmarks below for different
targets and different applications),
by applying three extra optimization passes on the binary image of your program.
|
Currently available for most targets supported by Raisonance (including 8051, XA, ST7, ST5 and CoolRISC (C816)),
CodeCompressor is fully integrated into RIDE and, because it has an overall view of the whole application,
it performs optimizations a compiler could not do.
View
CodeCompressor animated presentation (requires Microsoft Internet Explorer,
use the Full Screen Presentation option for the best result)
Download CodeCompressor description
as a pdf file
(62 Kb)
How does CodeCompressor work?
CodeCompressor is a complement to traditional optimizing compilers (that can only see one module at a time, thus limiting the scope of optimization):
CodeCompressor acts after the linker, when all the intra-module optimizations have already been performed.
|
|
|
What does it do?
CodeCompressor acts in 3 passes, each of which can be automatically or manually controlled.
|
|
|
InLining
In this phase CodeCompressor will look for functions that are called only once in
the application and will move them to the place where they are called, thus saving the
CALL and RET instructions. This kind of optimization improves both the code size and the execution speed.
Factorization
In this phase CodeCompressor will look everywhere in the binary file for identical blocks of
code and will put them in subroutines when they are big enough. This kind of optimization will
improve code size, but will slow down execution, so you might want to turn it off for time-critical
parts of your application.
Local Optimizations (Peephole)
In this phase CodeCompressor will rescan the whole code for the last time looking for
local optimizations, such as long jumps and calls replacement with the equivalent shorter
version where possible. This kind of optimization improves both code size and execution speed.
As this last optimization is very dependent on the architecture (more than the first two), it will be possible
in the future to specify the optimization to be done in a sort of script language (Raisonance will provide some
basic ones, and any user could add/customize to his specific needs).
Starting around BN730 (depending on the target), CodeCompressor peephole optimization can be completed and enhanced
using the Raisonance Peephole Script (RPS) language to implement your own optimizations. Check out
this page for more details.
|
|
Benchmarks
CodeCompressor main purpose is to reduce the memory size (code) of your application: all the benchmarks measure
code size only.
Compression rates varies largely from 0 (for a very small, assembly written program) to >50% (for applications
written in a 'repetitive' way, for example using a lot of macros).
Several factors come into play when estimating the compression rate you could get on your application, including:
- The programming style
- The programming language
- The performance of the toolchain (mainly the compiler)
- The architecture
For a typical application (some kb), written in C, a typical compression rate would be between 5% and 25%.
The links below give some more indication on the results obtained on different tests and different architectures.
|
|
Try CodeCompressor (download)
CodeCompressor is included in the demo version of all toolchains for which it is available. You can compress your code and
simulate it; the only limitation of the demo version is you cannot save the compressed code.
Click here to access the download section; once you have installed the tools, open any project and click on the CodeCompressor icon.
|
Compatibility
Because it requires strict interaction with many other tools in the toolchain, CodeCompressor works only with Raisonance
tools. Note however that we have already successfully integrated at least one external Compiler (a port of GNU for the CoolRISC),
and made it work with CodeCompressor.
For more information about CodeCompressor please email support@raisonance.com
|