Valid HTML 4.01! Valid CSS!

ccg: dynamic code generation for C and C++

Ian Piumarta

This document contains brief notes on ``ccg'', a combination of preprocessor and ``runtime assembler'' for C and C++ programs. It allows extremely efficient dynamic code generation for PowerPC, Sparc and Pentium to be embedded in arbitrary C programs. Dynamically generated code is specified using the standard assembler syntax of the target platform, with extensions to allow C expressions to appear in operands. The program can therefore ``specialize'' all aspects of the generated code at runtime: literal operands, register selection, jump/branch destinations, elements of complex addressing modes, and so on. The system is written entirely in ANSI C, and requires no compiler-specific extensions (such as inline asm statements or the various assembler-related extensions implemented by gcc).

This document is also available in PostScript and PDF.

Version 1.0alpha is now available for download: ccg-1.0a.tgz (gzipped tar archive).

1. Introduction

2. Using ccg

3. Platform-specific notes

4. Customising ccg's behaviour

5. Example programs

Last modification on: Sun May 01 2004 - 22:46:07