[LLVMdev] LLVM Newb: Getting started

Anton Korobeynikov asl at math.spbu.ru
Thu Nov 23 23:29:15 PST 2006


Hello, Wolfgang.

> * How can I define parts of the ABI that cover calling conventions?
You should write some parts of codegen, which will translate specific
CC'ed code to the target assembler. In general, you have to write 2
routines:
1. Lowering of formal arguments (when function call is performed,
function should "see" supplied arguments with specific CC)
2. Lowering of call itself.

Look into lib/Target/X86/X86ISelLowering.cpp for examples of code (C,
fast, fastcall, stdcall calling conventions are included).

> into the created binary. And I'd like to try, to let the thing to 
> create CLI binaries 
> <http://www.ecma-international.org/publications/standards/Ecma-335.htm>.
I agree with Reid, what CBackend should be used as an example. CLI has
many simular parts with LLVM IR. AFAIK, the following things should be
done:

1. Emulation of shufflevector, vsetint, vsetfp, vselect, select, setcc,
phi LLVM instructions in CIL
2. Emulation of LLVM intrinsics.

Other things can be translated to CIL without problems, I hope.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.





More information about the llvm-dev mailing list