OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:00 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
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.


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:04 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
P.S it's theme for selecting code generation tehnique for my compiler, not only opinion based.


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:09 am 
Offline
Member
Member
User avatar

Joined: Thu Mar 27, 2014 3:57 am
Posts: 568
Location: Moscow, Russia
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.

_________________
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay


Last edited by Roman on Mon Jan 30, 2017 2:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:15 am 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
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


Last edited by glauxosdever on Mon Jan 30, 2017 2:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:19 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
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.


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:35 am 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
monobogdan wrote:
LLVM can't compile bootsector, it's too large.


This is false.

llvm.org - read the docs

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 2:37 am 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
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

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 3:16 am 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
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.

_________________
Learn to read.


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 4:31 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
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.


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 12:05 pm 
Offline
Member
Member

Joined: Sat Nov 07, 2015 3:12 pm
Posts: 145
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


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Mon Jan 30, 2017 9:47 pm 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
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

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: LLVM vs Pure ASM
PostPosted: Tue Jan 31, 2017 1:28 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group