From 0aa7d1ec05c7e8816dffe8e70f970e571b9af6f4 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 19 May 2013 09:23:50 -0700 Subject: [PATCH] Adding libjit. Removing some old xethunk cruft. --- .gitmodules | 3 ++ common.gypi | 10 +------ docs/building.md | 6 ---- private/runtest.sh | 1 - src/xenia/cpu/codegen/recompiler.cc | 1 - src/xenia/cpu/ppc/state.h | 12 -------- .../kernel/modules/xboxkrnl/xboxkrnl_rtl.cc | 2 -- third_party/libjit | 1 + xenia-build.py | 28 ------------------- xenia.gyp | 2 ++ 10 files changed, 7 insertions(+), 59 deletions(-) create mode 160000 third_party/libjit diff --git a/.gitmodules b/.gitmodules index e27e2959d..cc0ae3d6d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "third_party/wslay"] path = third_party/wslay url = https://github.com/benvanik/wslay.git +[submodule "third_party/libjit"] + path = third_party/libjit + url = https://github.com/benvanik/libjit.git diff --git a/common.gypi b/common.gypi index 6a5b89a19..43fde47d3 100644 --- a/common.gypi +++ b/common.gypi @@ -2,14 +2,6 @@ { 'default_configuration': 'release', - 'conditions': [ - ['OS == "mac"', { - 'variables': { - 'is_clang': 1 - } - }], - ], - 'variables': { 'configurations': { 'debug': { @@ -122,7 +114,7 @@ 'DebugInformationFormat': '3', 'ExceptionHandling': '1', # /EHsc 'AdditionalOptions': [ - '/MP', + '/MP', # Multiprocessor '/TP', # Compile as C++ ], }, diff --git a/docs/building.md b/docs/building.md index 93366e61a..a3c8481a9 100644 --- a/docs/building.md +++ b/docs/building.md @@ -95,12 +95,6 @@ gyp/gypi files. xb gyp -#### xethunk - -Updates the checked-in `src/cpu/xethunk/xethunk.bc` and `xethunk.ll` files. -This is only required if changes are made to the xethunk files. The results -should be checked in. - #### build Builds all xenia targets using ninja. Release is built by default; specify diff --git a/private/runtest.sh b/private/runtest.sh index e1f54ba0b..28bf70f2f 100755 --- a/private/runtest.sh +++ b/private/runtest.sh @@ -1,4 +1,3 @@ -python xenia-build.py xethunk python xenia-build.py build if [ "$?" -ne 0 ]; then diff --git a/src/xenia/cpu/codegen/recompiler.cc b/src/xenia/cpu/codegen/recompiler.cc index f73505cd0..fe65c2e4a 100644 --- a/src/xenia/cpu/codegen/recompiler.cc +++ b/src/xenia/cpu/codegen/recompiler.cc @@ -34,7 +34,6 @@ #include #include #include -#include using namespace llvm; diff --git a/src/xenia/cpu/ppc/state.h b/src/xenia/cpu/ppc/state.h index 9fffab26b..94874ee44 100644 --- a/src/xenia/cpu/ppc/state.h +++ b/src/xenia/cpu/ppc/state.h @@ -10,21 +10,9 @@ #ifndef XENIA_CPU_PPC_STATE_H_ #define XENIA_CPU_PPC_STATE_H_ - -/** - * NOTE: this file is included by xethunk and as such should have a *MINIMAL* - * set of dependencies! - */ - #include -#ifdef XE_THUNK -#define XECACHEALIGN __attribute__ ((aligned(8))) -#define XECACHEALIGN64 __attribute__ ((aligned(64))) -#endif - - // namespace FPRF { // enum FPRF_e { // QUIET_NAN = 0x00088000, diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc index c7e5fe640..8228e0887 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_rtl.cc @@ -315,8 +315,6 @@ void RtlImageXexHeaderField_shim( // into guest memory, as it should be opaque and so long as our size is right // the user code will never know. // -// This would be good to put in xethunk for inlining. -// // Ref: http://msdn.microsoft.com/en-us/magazine/cc164040.aspx // Ref: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/critical.c?view=markup diff --git a/third_party/libjit b/third_party/libjit new file mode 160000 index 000000000..d002b47f6 --- /dev/null +++ b/third_party/libjit @@ -0,0 +1 @@ +Subproject commit d002b47f609617c4609ba4c3982ecb89223cb28c diff --git a/xenia-build.py b/xenia-build.py index 006c107f5..fb9f8c9e6 100755 --- a/xenia-build.py +++ b/xenia-build.py @@ -68,7 +68,6 @@ def discover_commands(): 'gyp': GypCommand(), 'build': BuildCommand(), 'test': TestCommand(), - 'xethunk': XethunkCommand(), 'clean': CleanCommand(), 'nuke': NukeCommand(), } @@ -459,33 +458,6 @@ class TestCommand(Command): return result -class XethunkCommand(Command): - """'xethunk' command.""" - - def __init__(self, *args, **kwargs): - super(XethunkCommand, self).__init__( - name='xethunk', - help_short='Updates the xethunk.bc file.', - *args, **kwargs) - - def execute(self, args, cwd): - print 'Building xethunk...' - print '' - - path = 'src/xenia/cpu/xethunk/xethunk' - result = shell_call('clang -emit-llvm -O0 -c %s.c -o %s.bc' % (path, path), - throw_on_error=False) - if result != 0: - return result - - shell_call('build/llvm/release/bin/llvm-dis %s.bc -o %s.ll' % (path, path)) - - shell_call('cat %s.ll' % (path)) - - print 'Success!' - return 0 - - class CleanCommand(Command): """'clean' command.""" diff --git a/xenia.gyp b/xenia.gyp index e752d5e53..3d28b8a3d 100644 --- a/xenia.gyp +++ b/xenia.gyp @@ -16,10 +16,12 @@ 'dependencies': [ 'gflags', 'wslay', + 'third_party/libjit/libjit.gyp:libjit', ], 'export_dependent_settings': [ 'gflags', 'wslay', + 'third_party/libjit/libjit.gyp:libjit', ], 'direct_dependent_settings': {