Andrew Lenharth
2010-Mar-19 13:02 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
On Mon, Mar 15, 2010 at 10:50 AM, Renato Golin <rengolin at systemcall.org> wrote:> On 10 March 2010 16:57, 琬菁楊 <ching1119.cs96 at g2.nctu.edu.tw> wrote: >> I think the main issue is that EFI C dialect is not ANSI-C compliant: the >> size of pointer is determined at the run-time and therefore the layout of >> the structure is not static. Does LLVM support this model? > > Hi Ching, > > The LLVM IR doesn't care about the size of your pointers, and this is > why you have the 'datalayout' explicit on the object file. I don't > know, however, if you can omit the layout definition and leave it for > run time.The layout for non-packed structures is, in this sense, left for runtime. The definition, if lacking any alignment attributes, will be layed out in the backend according to the alignment rules then. The IR layout definition can be happily cross-platform if you always access the structures in a type-safe way (using GEP, never castes, etc).> If LLVM doesn't allow omitting the layout, it should, as we now have > an use case that needs it. If it does, it should be just a matter of > converting the current IR into EFI bytecode and creating intrinsics to > deal with the run-time variables. You could even benefit from having > different languages (LLVM supports) into EFI bytecode...How does EFI describe structures if the pointer size can change? This shouldn't be a harder problem than C struct -> llvm struct. I assume the EFI bytecode has some way to describe them. What is it? (Question is for Ching) Andrew>> And I am wondering whether this kind of idea is valuable to the LLVM >> community? or are there any other related ideas is more valuable? > > I think that an open source compiler to EFI byte code is not only > desirable, but necessary. > > > cheers, > --renato > > http://systemcall.org/ > > Reclaim your digital rights, eliminate DRM, learn more at > http://www.defectivebydesign.org/what_is_drm > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Tristan Gingold
2010-Mar-19 13:11 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
> How does EFI describe structures if the pointer size can change? This > shouldn't be a harder problem than C struct -> llvm struct. I assume > the EFI bytecode has some way to describe them. What is it?EFI describe structures almost like C. There are EBC instructions that have two immediates: one for 32bits pointers and one for 64bits pointers.
琬菁楊
2010-Mar-19 18:08 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
Hello Tristan and all, I have already know that if I want to do this feature(c -> EFI Byte code) for GCC I should further modify the GCC front end(parser) to solve the problem (the size of pointer is determined at run time). I have read a powerpoint about LLVM ( http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf) It is the LLVM-GCC design graph ( http://www.im.ntu.edu.tw/~b95030/llvm_gcc.png<http://www.im.ntu.edu.tw/%7Eb95030/llvm_gcc.png> ). According to the above discussion , LLVM IR doesn't care about the size of pointers. I am wondering how could LLVM support dynamic pointer size model without modifying GCC front end?? thanks ching -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100320/b0a27655/attachment.html>
Chris Lattner
2010-Mar-19 19:47 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
On Mar 19, 2010, at 11:08 AM, 琬菁楊 wrote:> > Hello Tristan and all, > > I have already know that if I want to do this feature(c -> EFI Byte code) for GCC > I should further modify the GCC front end(parser) to solve the problem (the size > of pointer is determined at run time). > > I have read a powerpoint about LLVM (http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf) > It is the LLVM-GCC design graph (http://www.im.ntu.edu.tw/~b95030/llvm_gcc.png). > According to the above discussion , LLVM IR doesn't care about the size of pointers. > I am wondering how could LLVM support dynamic pointer size model without modifying > GCC front end??What do you mean by "variable sized pointers"? What does: struct S {void *X; }; return for sizeof(struct S); ? -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100319/4e5ea081/attachment.html>
琬菁楊
2010-Mar-31 02:41 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
Hello Tristan,> How does EFI describe structures if the pointer size can change? This > > shouldn't be a harder problem than C struct -> llvm struct. I assume > > the EFI bytecode has some way to describe them. What is it? > > EFI describe structures almost like C. > > There are EBC instructions that have two immediates: one for 32bits > pointers and one for 64bits pointers. >I have read the uefi specification 2.3 and survey the code of EBC VM It seems that there is no relationship between the EBC byte code and the processor. like CMPI[32|64][w|d]eq {@}R1 {Index16}, Immed16|Immed32, choosing which form is not depending on the processor but compiler(means 32-bit processor could even support 64-bit operand) Does it more feasible to implement it?? thanks ching -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100331/39592766/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM