From 4514fc12bd2a3ca341f2b11d6dffeebd75722c70 Mon Sep 17 00:00:00 2001 From: S Gopal Rajagopal Date: Mon, 20 Oct 2014 01:48:05 +0530 Subject: [PATCH] Updated Travis CI configuration to compile LLVM --- .travis.yml | 8 +++++++- rpcs3/CMakeLists.txt | 3 ++- rpcs3/Emu/Cell/PPULLVMRecompiler.cpp | 2 +- rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp | 10 ++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90ddcfd4de..cb0e8e7568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ compiler: branches: only: - master + - ppu_llvm_recompiler git: submodules: false @@ -27,7 +28,12 @@ before_install: sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr; before_script: - - git submodule update --init asmjit ffmpeg + - git submodule update --init asmjit ffmpeg llvm + - cd llvm_build + - cmake -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF ../llvm + - make -j 4 + - sudo make install + - cd .. - mkdir build - cd build - cmake .. diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index e87efc7527..1a33055bf4 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -102,7 +102,8 @@ RPCS3_SRC "${RPCS3_SRC_DIR}/../Utilities/*" ) -string(REGEX REPLACE "(.*);.*ConvertUTF.c;" "\\1;" RPCS3_SRC "${RPCS3_SRC}") +list(REMOVE_ITEM RPCS3_SRC ${RPCS3_SRC_DIR}/../Utilities/simpleini/ConvertUTF.c) +set_source_files_properties(${RPCS3_SRC_DIR}/Emu/Cell/PPULLVMRecompiler.cpp PROPERTIES COMPILE_FLAGS -fno-rtti) add_executable(rpcs3 ${RPCS3_SRC}) diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index 9a6ca1c46c..6573dbf872 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -4892,7 +4892,7 @@ PPULLVMEmulator::PPULLVMEmulator(PPUThread & ppu) s_num_instances++; if (!s_recompiler) { s_recompiler = new PPULLVMRecompiler(); - //s_recompiler->RunAllTests(&m_ppu, m_interpreter); + s_recompiler->RunAllTests(&m_ppu, m_interpreter); } } diff --git a/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp b/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp index 5e030f5d37..b90a7f1f0a 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp @@ -8,6 +8,8 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/MC/MCDisassembler.h" +//#define PPU_LLVM_RECOMPILER_UNIT_TESTS 1 + using namespace llvm; #define VERIFY_INSTRUCTION_AGAINST_INTERPRETER(fn, tc, input, ...) \ @@ -194,11 +196,14 @@ struct PPUState { } }; +#ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS static PPUThread * s_ppu_state = nullptr; static PPUInterpreter * s_interpreter = nullptr; +#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS template void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, PPULLVMRecompilerFn recomp_fn, PPUInterpreterFn interp_fn, PPUState & input_state, Args... args) { +#ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS auto test_case = [&]() { (this->*recomp_fn)(args...); }; @@ -224,9 +229,11 @@ void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, P return true; }; RunTest(name, test_case, input, check_result); +#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS } void PPULLVMRecompiler::RunTest(const char * name, std::function test_case, std::function input, std::function check_result) { +#ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS // Create the unit test function m_current_function = (Function *)m_module->getOrInsertFunction(name, m_ir_builder->getVoidTy(), m_ir_builder->getInt8PtrTy() /*ppu_state*/, @@ -301,9 +308,11 @@ void PPULLVMRecompiler::RunTest(const char * name, std::function test_ca } m_execution_engine->freeMachineCodeForFunction(m_current_function); +#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS } void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * interpreter) { +#ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS s_ppu_state = ppu_state; s_interpreter = interpreter; @@ -753,4 +762,5 @@ void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * inte VERIFY_INSTRUCTION_AGAINST_INTERPRETER(DCBZ, 1, input, 14, 23); initial_state.Store(*ppu_state); +#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS }