[cfe-dev] Target Definition for MicroBlaze

Chris Lattner clattner at apple.com
Fri Feb 26 10:47:22 PST 2010


On Feb 24, 2010, at 12:34 PM, Wesley Peck wrote:
> I have recently committed a LLVM backend for the MicroBlaze soft-processor to the LLVM repository. Attached is a Clang target definition for the new LLVM backend. I followed the example of other backends when creating this file. The only thing I was unsure about was how to support the MicroBlaze specific intrinsics.

The targets change looks good to me, but I don't like the #include of lib/Target/MBlaze/MBlazeIntrinsicInfo.h and the makefile change, please feel free to submit them.

> In all of the examples that I found the processor specific intrinsics were included in the main top level LLVM Intrinsic definitions (include/llvm/Intrinsics.td) but my backend does not include the processor specific intrinsics in the top level file. It defines them inside of the MicroBlaze target definition (lib/Target/MBlaze/MBlazeIntrinsics.td). This was done at the request of the LLVM developers.

Right.

> I solved this problem by modifying the Makefile for CodeGen so that the LLVM source and object directories were included on the C++ include path. I could then include the MicroBlaze specific intrinsic info file which gives me access to helper functions which return a intrinsic id given the GCC builtin name.
> 
> Whoever reviews the patch may want to look especially close at how this is done because it differs from what the other backends seemed to be doing.

I'm not really thrilled with this.  Instead of creating an instance of MBlazeIntrinsicInfo, can't you get the TargetIntrinsicInfo* from the target machine in a target independent way?

-Chris



More information about the cfe-dev mailing list