[LLVMdev] Enabling x86-64 JIT under Visual Studio compiler

Tim Foley tim.foley.is at gmail.com
Wed Jun 4 18:08:49 PDT 2008

I built the LLVM 2.2 distribution under Visual Studio for x86-64 just fine,
but then trying to run my first "hello world" application, found that the
JIT compiler was not enabled.
I'm completely new to LLVM, so I didn't know exactly where to look to see
why the JIT for my platform wasn't being built (is it in the configure
steps, or in the C++ code itself?). My educated guess is currently that
X86_64TargetMachine::getJITMatchQuality is the interesting point.

I have noticed that all the points in the codebase that try to detect x86-64
are currently using the gcc-style "__x86_64__" preprocessor symbol. The
Visual Studio compiler, instead, defines _M_X64 (similar to the _M_IX86
define that matches __x86__).

Adding a defined(_M_X64) case to all the existing #ifdefs is no big deal,
but I notice that two of them (one in X86JitInfo.cpp and one in
X86Subtarget.cpp) are guarding inline assembly blocks written in the
gcc-style inline assembly syntax.

Would adding cases for these assembly blocks that are in Visual Studio
syntax be enough to enable a working x86-64 JIT target under Windows builds?
I can't pretend to understand this codebase, so if there are more roadblocks
stopping 64-bit JIT on Windows targets I'd be interested to hear...

- Tim Foley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080604/bc4cdb0f/attachment.html>

More information about the llvm-dev mailing list