OSDev.org https://forum.osdev.org/ |
|
LLVM vs Pure ASM https://forum.osdev.org/viewtopic.php?f=13&t=31320 |
Page 1 of 1 |
Author: | monobogdan [ Mon Jan 30, 2017 2:00 am ] |
Post subject: | LLVM vs Pure ASM |
Yes, it's really stupid question, but, what better is LLVM or Pure ASM generation? LLVM is easy but generates garbage Pure is only for single architecture, but no garbage or anything. |
Author: | monobogdan [ Mon Jan 30, 2017 2:04 am ] |
Post subject: | Re: LLVM vs Pure ASM |
P.S it's theme for selecting code generation tehnique for my compiler, not only opinion based. |
Author: | Roman [ Mon Jan 30, 2017 2:09 am ] |
Post subject: | Re: LLVM vs Pure ASM |
If you think that you're smarter and have more man-years than all the people behind LLVM then pure assembly is better. Quote: LLVM is easy but generates garbage This is false.
|
Author: | glauxosdever [ Mon Jan 30, 2017 2:15 am ] |
Post subject: | Re: LLVM vs Pure ASM |
Hi, My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine. However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option. What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now. Regards, glauxosdever |
Author: | monobogdan [ Mon Jan 30, 2017 2:19 am ] |
Post subject: | Re: LLVM vs Pure ASM |
glauxosdever wrote: Hi, My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine. However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option. What I'm saying is that LLVM's IR isn't exactly the best solution, but it's probably the best of what we have now. Regards, glauxosdever LLVM can't compile bootsector, it's too large. |
Author: | dchapiesky [ Mon Jan 30, 2017 2:35 am ] |
Post subject: | Re: LLVM vs Pure ASM |
monobogdan wrote: LLVM can't compile bootsector, it's too large. This is false. llvm.org - read the docs |
Author: | dchapiesky [ Mon Jan 30, 2017 2:37 am ] |
Post subject: | Re: LLVM vs Pure ASM |
glauxosdever wrote: Hi, My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine. However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option. What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now. Regards, glauxosdever In the context of your example - llvm shines since you can write custom "passes" which allow you to modify the AST... so as you try different optimizations you can snapshot the AST, compare the AST, etc... google has some really nice llvm AST manipulation tools |
Author: | dozniak [ Mon Jan 30, 2017 3:16 am ] |
Post subject: | Re: LLVM vs Pure ASM |
monobogdan wrote: LLVM can't compile bootsector, it's too large. Your misconceptions drive your desire to develop bicycles and invent wheels instead of learning something useful from already made projects. You may start getting smarter and read, or keep writing. |
Author: | monobogdan [ Mon Jan 30, 2017 4:31 am ] |
Post subject: | Re: LLVM vs Pure ASM |
dchapiesky wrote: glauxosdever wrote: Hi, My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine. However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option. What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now. Regards, glauxosdever In the context of your example - llvm shines since you can write custom "passes" which allow you to modify the AST... so as you try different optimizations you can snapshot the AST, compare the AST, etc... google has some really nice llvm AST manipulation tools may be my acknowledge about llvm is too small. So, i'm try to port tcc to OGDOS. It's seems to be interestring. |
Author: | Boris [ Mon Jan 30, 2017 12:05 pm ] |
Post subject: | Re: LLVM vs Pure ASM |
Garbage comes when you feed something with wrong input. Did you tell llvm to generate 16 bit code ? I think if you don't know what you do , llvm will help you reducing your code size |
Author: | dchapiesky [ Mon Jan 30, 2017 9:47 pm ] |
Post subject: | Re: LLVM vs Pure ASM |
monobogdan wrote: So, i'm try to port tcc to OGDOS. tcc is good --- though there is a version for 64bit if you look for it... tcc shouldn't need much of a port at all post if you need help cheers |
Author: | monobogdan [ Tue Jan 31, 2017 1:28 am ] |
Post subject: | Re: LLVM vs Pure ASM |
dchapiesky wrote: monobogdan wrote: So, i'm try to port tcc to OGDOS. tcc is good --- though there is a version for 64bit if you look for it... tcc shouldn't need much of a port at all post if you need help cheers Hm. May be make freedos kernel only... first stage kernel? Like in windows. ntoskrnl is like to first stage kernel(and main kernel), kernel32.dll is api to kernel(and may be kernel stage two because it's 32 bit). So, example boot scheme: FreeDOS bootloader->FreeDOS kernel->32 bit bootloader->32 bit kernel->GUI |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |