Tool |
Description |
clang |
A front-end compiler for LLVM.
We use this tool to compile C to LLVM bytecode (which directly encodes the application as a single static assignment DAG).
This compiler is fully-featured, but no standard libraries are available (you will not be able to use things like malloc). |
llvm-link |
The LLVM linker, which we will use to stich together several compiled files into one object file (expressed in LLVM bytecode assembly) |
llc |
The LLVM static compiler.
We extended this tool to translate LLVM bytecode to MIPS150 assembly.
This tool lacks a number of obvious features, such as support for byte, half, and double-word memory accesses, as well as floating point arithmetic. In other words, char pointers and floats will not work! |
mars (coming later this week) |
A java-based assembler and simulator for MIPS.
We stripped this tool down by removing features not present in MIPS150, and relaxed the parser to accept compiler output. |
To summarize, your C code follows the following path:
Missing |
Therefore |
Non-32b memory accesses |
Although you can manipulate chars and other data types on the stack, you will not be able to dereference their pointers or create arrays.
Our architecture lacks the load/store byte and half instructions, making byte access rather annoying (HW6, problem 2).
If time permits, we will add this feature to the llc tool. |
Floating point arithmetic |
Since we obviously didn't ask you to build a floating point unit, we will rely on software for floating point arithmetic.
If time permits (and it looks like it will), we will use the SoftFloat library (by John Hauser, who was once John Wawrzynek's PhD student). |
Linker |
The linker is now provided, and a single program can be expressed in multiple C files. |
Standard libraries |
Unfortunately we are unable to provide implementations of the C standard library files (all of the things #include to make life easier).
These libraries are implemented on a per-system basis, and are quite large.
The main consequence is the lack of support for strings and dynamic memory management.
We will write a few and make them available, but you will have to write your own routines if you need them.
Dereference integer constants to access physical memory |