Collberg's Software Compiler Retargeting Research
Collberg's Software Compiler Retargeting Research



There are three popular methods for constructing highly retargetable compilers: (1) the compiler emits abstract machine code which is interpreted at run-time, (2) the compiler emits C code which is subsequently compiled to machine code by the native C compiler, or (3) the compiler's code-generator is generated by a back-end generator from a formal machine description produced by the compiler writer.

These methods incur high costs at run-time, compile-time, or compiler-construction time, respectively.

We're interested in a fourth method which combines the fast retargeting of C code generating compilers with the efficiency of specification-driven code generators.

The basic idea is to use the native C compiler at compiler construction time to discover architectural features of the new architecture. From this information a formal machine description is produced. Given this machine description, a native code-generator can be generated by a back-end generator such as BEG or burg.


Download

To try out the system you need (at least) Sicstus Prolog and gawk.

Publications
Christian S. Collberg Reverse Interpretation + Mutation Analysis = Automatic Retargeting June, 1997
ACM SIGPLAN '97 Conference on Programming Language Design and Implementation (PLDI'97) Las Vegas, Nevada pp. 55-70
Christian S. Collberg Automatic Derivation of Machine Descriptions February, 1997
Proceedings of the Twentieth Australasian Computer Science Conference Sydney, Australia pp. 253-264