mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-28 09:23:34 +00:00
Updated Travis CI configuration to compile LLVM
This commit is contained in:
parent
024c15d4d3
commit
4514fc12bd
@ -7,6 +7,7 @@ compiler:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
- ppu_llvm_recompiler
|
||||||
|
|
||||||
git:
|
git:
|
||||||
submodules: false
|
submodules: false
|
||||||
@ -27,7 +28,12 @@ before_install:
|
|||||||
sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr;
|
sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr;
|
||||||
|
|
||||||
before_script:
|
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
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake ..
|
- cmake ..
|
||||||
|
@ -102,7 +102,8 @@ RPCS3_SRC
|
|||||||
"${RPCS3_SRC_DIR}/../Utilities/*"
|
"${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})
|
add_executable(rpcs3 ${RPCS3_SRC})
|
||||||
|
|
||||||
|
@ -4892,7 +4892,7 @@ PPULLVMEmulator::PPULLVMEmulator(PPUThread & ppu)
|
|||||||
s_num_instances++;
|
s_num_instances++;
|
||||||
if (!s_recompiler) {
|
if (!s_recompiler) {
|
||||||
s_recompiler = new PPULLVMRecompiler();
|
s_recompiler = new PPULLVMRecompiler();
|
||||||
//s_recompiler->RunAllTests(&m_ppu, m_interpreter);
|
s_recompiler->RunAllTests(&m_ppu, m_interpreter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/MC/MCDisassembler.h"
|
#include "llvm/MC/MCDisassembler.h"
|
||||||
|
|
||||||
|
//#define PPU_LLVM_RECOMPILER_UNIT_TESTS 1
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#define VERIFY_INSTRUCTION_AGAINST_INTERPRETER(fn, tc, input, ...) \
|
#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 PPUThread * s_ppu_state = nullptr;
|
||||||
static PPUInterpreter * s_interpreter = nullptr;
|
static PPUInterpreter * s_interpreter = nullptr;
|
||||||
|
#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS
|
||||||
|
|
||||||
template <class PPULLVMRecompilerFn, class PPUInterpreterFn, class... Args>
|
template <class PPULLVMRecompilerFn, class PPUInterpreterFn, class... Args>
|
||||||
void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, PPULLVMRecompilerFn recomp_fn, PPUInterpreterFn interp_fn, PPUState & input_state, Args... 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 = [&]() {
|
auto test_case = [&]() {
|
||||||
(this->*recomp_fn)(args...);
|
(this->*recomp_fn)(args...);
|
||||||
};
|
};
|
||||||
@ -224,9 +229,11 @@ void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, P
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
RunTest(name, test_case, input, check_result);
|
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) {
|
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
|
// Create the unit test function
|
||||||
m_current_function = (Function *)m_module->getOrInsertFunction(name, m_ir_builder->getVoidTy(),
|
m_current_function = (Function *)m_module->getOrInsertFunction(name, m_ir_builder->getVoidTy(),
|
||||||
m_ir_builder->getInt8PtrTy() /*ppu_state*/,
|
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);
|
m_execution_engine->freeMachineCodeForFunction(m_current_function);
|
||||||
|
#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * interpreter) {
|
void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * interpreter) {
|
||||||
|
#ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS
|
||||||
s_ppu_state = ppu_state;
|
s_ppu_state = ppu_state;
|
||||||
s_interpreter = interpreter;
|
s_interpreter = interpreter;
|
||||||
|
|
||||||
@ -753,4 +762,5 @@ void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * inte
|
|||||||
VERIFY_INSTRUCTION_AGAINST_INTERPRETER(DCBZ, 1, input, 14, 23);
|
VERIFY_INSTRUCTION_AGAINST_INTERPRETER(DCBZ, 1, input, 14, 23);
|
||||||
|
|
||||||
initial_state.Store(*ppu_state);
|
initial_state.Store(*ppu_state);
|
||||||
|
#endif // PPU_LLVM_RECOMPILER_UNIT_TESTS
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user