X86-64 target

Hello, I'm currently porting our software to the x86-64 (windows) platform. Since we're using LLVM for dynamic code generation it's not just a matter of fixing the compilation problems but also re-targeting the x86 backend to use 64 bit pointers everywhere. I'm not familiar with the x86-64 instruction set, so I really have no idea how much work this will be. My question is really if anyone is already working on this, perhaps on a 64-bit Linux? I've already done most of the work involved in getting LLVM itself to run on 64-bit windows, but of course that doesn't help much as long as the emitted code is 32-bit...

Hello, I'm currently porting our software to the x86-64 (windows) platform. I've already done most of the work involved in getting LLVM itself to run on 64-bit windows, but of course that doesn't help much as long as the emitted code is 32-bit...

My understanding is that LLVM builds fine on AMD64 machines running Linux, and we'd obviously be happy to merge in changes you made to make it work well on Win64.

Since we're using LLVM for dynamic code generation it's not just a matter of fixing the compilation problems but also re-targeting the x86 backend to use 64 bit pointers everywhere. I'm not familiar with the x86-64 instruction set, so I really have no idea how much work this will be. My question is really if anyone is already working on this, perhaps on a 64-bit Linux?

Unfortunately, there is no work (that I'm aware of) to add 64-bit X86 support yet. The plans I'm aware of to add this will start in 4-5 months. If you were already familiar with the architecture and the LLVM code generator, I would guess it could be done in 3-4 weeks without a problem. If not on both counts, it might take a few more months.

-Chris

Chris Lattner wrote:

Hello, I'm currently porting our software to the x86-64 (windows) platform. I've already done most of the work involved in getting LLVM itself to run on 64-bit windows, but of course that doesn't help much as long as the emitted code is 32-bit...

My understanding is that LLVM builds fine on AMD64 machines running Linux, and we'd obviously be happy to merge in changes you made to make it work well on Win64.

I have new project files for VS2005 and several patches to the X86 target (to get it to compile at all) and to the System/* files for windows. Unfortunately, all this is based on the 1.5 release of LLVM that is used in our software - I'll probably upgrade to the latest release in a few weeks, but I don't want to keep tracking the development version. I don't think it will be too much of a problem, though - as the files I've patch don't seem to change very often. I will submit my patches once I've had time to bring them up to date with the development version.

Since we're using LLVM for dynamic code generation it's not just a matter of fixing the compilation problems but also re-targeting the x86 backend to use 64 bit pointers everywhere. I'm not familiar with the x86-64 instruction set, so I really have no idea how much work this will be. My question is really if anyone is already working on this, perhaps on a 64-bit Linux?

Unfortunately, there is no work (that I'm aware of) to add 64-bit X86 support yet. The plans I'm aware of to add this will start in 4-5 months. If you were already familiar with the architecture and the LLVM code generator, I would guess it could be done in 3-4 weeks without a problem. If not on both counts, it might take a few more months.

Ok, I will have to wait then.

m.

Please submit the patches to me. I can't directly use any VS2005 changes, so I'll have to back port them to VS2003. There have been significant changes to the project files since 1.5.

Morten Ofstad wrote:

Okay. Like Jeff said, he's a good channel to get the patches applied. libsystem hasn't changed much since 1.5, so those patches should basically just apply like you said.

If you have x86-specific changes I can take a look. The X86 backend has changed *significantly* in the last couple of releases, and will be making another big leap in the next couple of weeks.

Evan Cheng is also planning on adding vector SSE support to the X86 backend in the next couple of months: if your compiler is generating values with packed types, it should automatically take advantage of this support.

Finally, if you're upgrading to CVS head and using packed types, you might want to take advantage of the new InsertElement and ExtractElement instructions that Rob Bocchino added to LLVM:
http://llvm.cs.uiuc.edu/docs/LangRef.html#i_extractelement
http://llvm.cs.uiuc.edu/docs/LangRef.html#i_insertelement

As usual, if you run into any problems or any mysteries, email llvmdev and we'd be happy to help! :slight_smile:

-Chris