||1 year ago|
|src||1 year ago|
|test||1 year ago|
|.gitignore||1 year ago|
|Makefile||1 year ago|
|license.txt||1 year ago|
|readme.md||1 year ago|
Optimizing compiler from brainfuck to AMD64. It turns a brainfuck input file into AMD64 code in memory then executes it.
Code generation is done in two steps. First the brainfuck program is turned into a custom IL, applying a few optimizations in the process. The IL tree is then fed into the machine code generator which generates x86_64 code from the tree.
Perfomance testing was done using Erik Bosman's Mandelbrot set viewer on an Intel i7-4700M. The results are the sum of compile and execution time averaged across 3 runs.
|Jump pre-computing interpreter||30s|
|Brainfuck to C translator (-O0)||0.2s + 3.5s|
|Brainfuck to C translator (-O3)||2s + 1s|
|bfjit||0.01s + 1s|
Currently bfjit only does optimizations on the Brainfuck tree, but further optimizations are possible both in the Brainfuck and IL stages.