LLVM vs Pure ASM
-
- Member
- Posts: 71
- Joined: Wed Jan 25, 2017 3:37 pm
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.
LLVM is easy but generates garbage
Pure is only for single architecture, but no garbage or anything.
-
- Member
- Posts: 71
- Joined: Wed Jan 25, 2017 3:37 pm
Re: LLVM vs Pure ASM
P.S it's theme for selecting code generation tehnique for my compiler, not only opinion based.
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.
This is false.LLVM is easy but generates garbage
Last edited by Roman on Mon Jan 30, 2017 2:19 am, edited 1 time in total.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
-
- Member
- Posts: 501
- Joined: Wed Jun 17, 2015 9:40 am
- Libera.chat IRC: glauxosdever
- Location: Athens, Greece
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
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
Last edited by glauxosdever on Mon Jan 30, 2017 2:19 am, edited 1 time in total.
-
- Member
- Posts: 71
- Joined: Wed Jan 25, 2017 3:37 pm
Re: LLVM vs Pure ASM
LLVM can't compile bootsector, it's too large.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
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: LLVM vs Pure ASM
This is false.monobogdan wrote: LLVM can't compile bootsector, it's too large.
llvm.org - read the docs
Plagiarize. Plagiarize. Let not one line escape thine eyes...
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: LLVM vs Pure ASM
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 toolsglauxosdever 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
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: LLVM vs Pure ASM
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.monobogdan wrote: LLVM can't compile bootsector, it's too large.
Learn to read.
-
- Member
- Posts: 71
- Joined: Wed Jan 25, 2017 3:37 pm
Re: LLVM vs Pure ASM
may be my acknowledge about llvm is too small.dchapiesky wrote: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 toolsglauxosdever 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
So, i'm try to port tcc to OGDOS.
It's seems to be interestring.
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
I think if you don't know what you do , llvm will help you reducing your code size
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: LLVM vs Pure ASM
tcc is good --- though there is a version for 64bit if you look for it...monobogdan wrote:So, i'm try to port tcc to OGDOS.
tcc shouldn't need much of a port at all
post if you need help
cheers
Plagiarize. Plagiarize. Let not one line escape thine eyes...
-
- Member
- Posts: 71
- Joined: Wed Jan 25, 2017 3:37 pm
Re: LLVM vs Pure ASM
Hm. May be make freedos kernel only... first stage kernel? Like in windows.dchapiesky wrote:tcc is good --- though there is a version for 64bit if you look for it...monobogdan wrote:So, i'm try to port tcc to OGDOS.
tcc shouldn't need much of a port at all
post if you need help
cheers
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