[llvm-dev] Porting LLVM to OpenVMS

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 10 10:09:30 PST 2017


> On Jan 10, 2017, at 12:41 AM, Patrik Eklöf via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Dear community,
>  
> My company is interested in porting LLVM to OpenVMS. To do so, we need to look at extending the AMD64 calling convention to suit the existing calling conventions available on OpenVMS.
>  
> We realize LLVM is a big and complex project and for some people who has not worked on it before, it’s going to be a big and tough job that is going to take a lot of time. Still, the job has to be done and we have to start somewhere, so any help or direction would be great.
>  
> Now, as to what we need:
> -          To pass the argument count to the callee
> -          Reserving registers for mapping variables directly to them
>  
> We need to look at passing the argument count (i.e. number of arguments passed) to functions in some register. One way that we have considered is to use the second byte of AL to hold the argument count. Do you think that would work well with how LLVM works today? Or is there an alternative way that you would suggest?
>  
> We also need to look at reserving registers because existing OpenVMS code relies on being able to map variables directly to registers so that multiple functions can share variables directly inside registers. We may need to reserve up to as many as 6 registers. Do you think this might work? Or will this make codegen bad? We have also considered trying to put these variables into an array and reserving a global variable to index into this array, thereby emulating this feature. Do you think this will work better?
>  
> It would be great to get some information to cut down on the area we need to concentrate on to get started. Any help or direction would be great.

I don't see a problem doing any of these (of course it will take some getting used to how all those things work in llvm). You can express storing a number in a fixed register with selection DAG CopyToReg and you can reserve registers.

Look around X86ISelLowering.cpp esp. LowerCall() and X86RegisterInfo::getReservedRegs().

- Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170110/62fda5f1/attachment.html>


More information about the llvm-dev mailing list