X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Finternship.git;a=blobdiff_plain;f=Report%2FMain%2FContext%2FMontiumC.tex;h=e9eb3bfe30383eb3d9b3f5760f882a0377e66675;hp=d563209bd246d486c2f97641d369ddf4e8b8c9b9;hb=0ac3f8b7cfb60e71b9f95dc8bf1752e1e971685f;hpb=1ae051d27cb9debbfa570ac82846c8a8d86287f2 diff --git a/Report/Main/Context/MontiumC.tex b/Report/Main/Context/MontiumC.tex index d563209..e9eb3bf 100644 --- a/Report/Main/Context/MontiumC.tex +++ b/Report/Main/Context/MontiumC.tex @@ -16,23 +16,28 @@ mapped onto the Montium ALU when compiling with the Montium-specific backend. When compiling with a normal C compiler, these functions are implemented by a library implemented in C. -Figure \ref{CompilingMontiumC} show the flow for compiling a MontiumC program +Figure \ref{CompilingMontiumC} shows the flow for compiling a MontiumC program into a Montium binary file, which can be loaded directly onto a Montium. The process is roughly divided into two parts (each of which corresponds to a different program in the compiler suite): The frontend and the backend. The frontend takes in a MontiumC program and turns it into a lower level -description of the program (LLVM Intermediate Representation, see the next -section). The frontend is responsible for mapping higher level -C constructs onto simpler instructions, for canonicalizing and simplifying the -code. These canonicalizations and simplifications ensure that the backend can be -kept simpler and does not have to deal with all the complexities of the original -program. +description of the program (the Montium intermediate representation). +The frontend is responsible for mapping higher level C constructs onto +simpler instructions, for canonicalizing and simplifying the code. These +canonicalizations and simplifications ensure that the backend can be +kept simpler and does not have to deal with all the complexities of the +original program. The frontend is again divided into two pieces, the first of which -transforms C code into an intermediate representation (also see section -\ref{LLVM}). The second part transforms this intermediate representation, output -again a (reduced form of) this representation. +transforms C code into an intermediate representation (called LLVM IR). +For the first part the Clang compiler, part of the LLVM project, is used +mostly unmodified. See section \ref{LLVM} for an overview of the LLVM +project. The second part transforms this intermediate representation +into a simpler form, which is more suitable for mapping onto the Montium +hardware by the backend. The output of this transformation is again in +the the same format, but with a lot of additional constraints. This +extra constrained format is referred to as Montium IR. The backend, in turn, takes in this reduced description of the program and transforms this into a valid Montium binary. To do this, it must find an ALU