Updated Travis CI configuration to compile LLVM

This commit is contained in:
S Gopal Rajagopal 2014-10-20 01:48:05 +05:30 committed by S Gopal Rajagopal
parent 024c15d4d3
commit 4514fc12bd
4 changed files with 20 additions and 3 deletions

View File

@ -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 ..

View File

@ -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})

View File

@ -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);
}
}

View File

@ -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 <class PPULLVMRecompilerFn, class PPUInterpreterFn, class... Args>
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<void()> test_case, std::function<void()> input, std::function<bool(std::string & msg)> 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<void()> 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
}