forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LLVM and the current toolchain

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Heimdall



Joined: 10 Nov 2005
Posts: 259
Location: Netherlands

PostPosted: Thu Sep 11, 2008 7:24 pm    Post subject: LLVM and the current toolchain Reply with quote

Hi guys,

Lately I've been interested on LLVM, it looks like a very promissing project and it could be nice to write a code emitter for the MIPS allegrex CPU for it. IMHO this would simplify the development since we can build the LLVM for any platform and just retarget our final ASM to the PSP CPU.

Anyone thinks this is a good idea or the current GCC and SDK is the way to go instead of writting LLVM bitcode and then cross compile to the PSP.

They claim that using their optimizer the generated assembly is (sometimes) better than the GCC one...

I just would like to hear some feedback from the forum on this!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Thu Sep 11, 2008 9:43 pm    Post subject: Reply with quote

I was interested. But my experience with their old llvm-gcc 4.0 (LLVM 2.0) for iPhone shows me they still need to improve. I tried a PC cygwin version once but it generated a bad executable (i mean it wasn't right at computation) but it was a long time go.

Honestly, I was hoping for llvm, because it may be easier to add vfpu auto-vectorization.

The MIPS target contributer is normally considering a port for Allegrex (he posted once here for questions about FPU cycles) but i don't know about the real progress on it.

It's pretty hard for me to say if the new LLVM 2.2 is doing better for optimization as I didn't try it.

Anyway, if you are planning to do something for a psp port of llvm, you can count on me to help you.
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Thu Sep 11, 2008 9:47 pm    Post subject: Reply with quote

and clang may also be promising as a replacement of gcc too : http://clang.llvm.org/.
Back to top
View user's profile Send private message
Heimdall



Joined: 10 Nov 2005
Posts: 259
Location: Netherlands

PostPosted: Thu Sep 11, 2008 10:27 pm    Post subject: Reply with quote

Yes, clang looks promissing the only thing that worries me is that we need to compile all the SDK with it, i don't know if the gcc libs are compatible with llvm. What worries me there is the fact that we have some ASM specific code (all the .S files in the SDK) that I'm not sure how would llvm and clang handle...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Sep 12, 2008 12:02 am    Post subject: Reply with quote

so far, llvm-gcc produces :

1) direct 'as' sources
2) 'llvm' sources

if i'm not wrong llvm produces 'as' sources.

for the JIT, i dunno.

EDIT:

"The llvm-ld program has limited support for native code generation, when using the -native or -native-cbe options. Native code generation is performed by converting the linked bitcode into native assembly (.s) or C code and running the system compiler (typically gcc) on the result."
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Fri Sep 12, 2008 7:42 pm    Post subject: Reply with quote

....as far as i can see, Clang is very promising, but still severly limited "for the next two years" (as you can read on its site).... The idea to compile hi level code in low level bytecode for an ideal virtual machine surrounded by plenty of metadata and then give the ability to turn this into native code on release time is very smart. But this is all concerning only CPU....what about the remaining hardware of the platform? LLVM will not be able to automagically translate memory maps or device commands...I doubt this way one could mantain a single code for multiple platforms as PC/PSP without major differentiations usually handled with tons of "#ifdef"....
What do you think about it?
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Sep 12, 2008 8:09 pm    Post subject: Reply with quote

Quote:
but still severly limited "for the next two years"

that's for C++, C and Objective-C are already implemented even if they may be considered in alpha/beta stage.

Quote:
LLVM will not be able to automagically translate memory maps or device commands

Nor does GCC ! and I'm not sure you look at LLVM : it is written in C++ and is largely modular and probably easier adaptable, customisable and maintenable unlike GCC. You can also have a JIT engine to generate Allegrex code in run-time, but I don't see it as the primary goal for a PSP port. I see it as an alternative to GCC.

Another interesting purpose :
http://lucille.lefora.com/2008/05/06/rsl-llvm-compiler-project-started/page1/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group