This is a very dumb C-subset compiler generating Logick code using a stack-based register allocation scheme. No real attempt at optimization has been made; even constant folding is not done. The language subset is small and slightly broken, but understands the 16-bit types int and float and the 8-bit pair types, ints and posits. Floating-point constants are recognized, and pair constants can be written using brackets, e.g., [1.0,2.0]. Full C source code is at gbcc.c.
Enter/edit your Gr8BOnd C-subset program here: int i; ints ii; float f; posits pp; int main() { ii = [0, 0]; f = 0.0; pp = f; for (i=0; i<10; ++i) { ii = ii + [1, 1]; f = f + 1.0; pp = pp + [1.0, 1.0]; } }
The C program that generated this page was written by Hank Dietz using the CGIC library to implement the CGI interface.
Advanced Computer Architecture.