[LLVMdev] [patch] MicroBlaze Backend
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Jan 29 16:43:29 PST 2010
On Jan 29, 2010, at 9:42 AM, Wesley Peck wrote:
> I have been working on a LLVM backend for the MicroBlaze soft-processor:
> http://www.xilinx.com/tools/microblaze.htm
> http://en.wikipedia.org/wiki/MicroBlaze
Very Cool!
> Attached is the initial MicroBlaze patch. It does the following:
> 1. Adds mblaze as a target in configure and configure.ac
> 2. Adds mblaze specific intrinsics in include/llvm/IntrinsicsMBlaze.td and include/llvm/Intrinsics.td
> 3. Adds mblaze triple support in include/llvm/ADT/Triple.h and lib/Support/Triple.cpp
> 4. Adds mblaze backend support in lib/Target/MBlaze
> 5. Adds mblaze test cases in test/CodeGen/MBlaze
>
> Currently the MicroBlaze backend generates MicroBlaze assembly which compiles successfully using the MicroBlaze assembler. Many small to medium sized test cases seem to compile and work but extensive testing has not yet been done.
Your patch looks very clean. Some comments:
- You don't need the -mb-has-* options in MBlazeSubtarget.cpp. You can pass -mattr=+mul,-div to llc and ParseSubtargetFeatures will take care of the rest.
- Please try to move your intrinsics into the target subdirectory. So far only Blackfin has done that, but we would like to keep everything target-specific in lib/Target/MBlaze.
- Please use lower-case register names in assembly if the assembler allows it.
- I think you have some literal tabs in your instruction descriptions.
- Your tests are nice, but you could use some more of them. I would recommend tests for tricky calling convention stuff, some loops, switches and branches. Also indirect calls and indirect branches. Have you tries running Codegen/generic through your back end? That should give you some more test cases.
The MicroBlaze is highly configurable and fairly simple. It would be a great addition to LLVM, also for educational purposes.
/jakob
More information about the llvm-dev
mailing list