mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-24 19:52:37 +01:00
Merge pull request #1332 from vlj/llvm-tests
Move llvm tests to VS unit testing framework
This commit is contained in:
commit
be1c9100cc
960
rpcs3-tests/ps3_ppu_llvm.cpp
Normal file
960
rpcs3-tests/ps3_ppu_llvm.cpp
Normal file
@ -0,0 +1,960 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#define LLVM_AVAILABLE
|
||||
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Cell/PPULLVMRecompiler.h"
|
||||
#include "llvm/Support/Host.h"
|
||||
#include "llvm/IR/Verifier.h"
|
||||
#include "llvm/ExecutionEngine/GenericValue.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/MC/MCDisassembler.h"
|
||||
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
#include "llvm/Analysis/TargetTransformInfo.h"
|
||||
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
|
||||
#include "llvm/Analysis/LoopInfo.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/IR/Dominators.h"
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
#include "llvm/Transforms/Vectorize.h"
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace ppu_recompiler_llvm;
|
||||
|
||||
/// Register state of a PPU
|
||||
struct ppu_recompiler_llvm::PPUState {
|
||||
/// Floating point registers
|
||||
PPCdouble FPR[32];
|
||||
|
||||
///Floating point status and control register
|
||||
FPSCRhdr FPSCR;
|
||||
|
||||
/// General purpose reggisters
|
||||
u64 GPR[32];
|
||||
|
||||
/// Vector purpose registers
|
||||
v128 VPR[32];
|
||||
|
||||
/// Condition register
|
||||
CRhdr CR;
|
||||
|
||||
/// Fixed point exception register
|
||||
XERhdr XER;
|
||||
|
||||
/// Vector status and control register
|
||||
VSCRhdr VSCR;
|
||||
|
||||
/// Link register
|
||||
u64 LR;
|
||||
|
||||
/// Count register
|
||||
u64 CTR;
|
||||
|
||||
/// SPR general purpose registers
|
||||
u64 SPRG[8];
|
||||
|
||||
/// Time base register
|
||||
u64 TB;
|
||||
|
||||
/// Memory block
|
||||
u32 address;
|
||||
u64 mem_block[64];
|
||||
|
||||
void Load(PPUThread & ppu, u32 addr) {
|
||||
for (int i = 0; i < 32; i++) {
|
||||
FPR[i] = ppu.FPR[i];
|
||||
GPR[i] = ppu.GPR[i];
|
||||
VPR[i] = ppu.VPR[i];
|
||||
|
||||
if (i < 8) {
|
||||
SPRG[i] = ppu.SPRG[i];
|
||||
}
|
||||
}
|
||||
|
||||
FPSCR = ppu.FPSCR;
|
||||
CR = ppu.CR;
|
||||
XER = ppu.XER;
|
||||
VSCR = ppu.VSCR;
|
||||
LR = ppu.LR;
|
||||
CTR = ppu.CTR;
|
||||
TB = ppu.TB;
|
||||
|
||||
address = addr;
|
||||
for (int i = 0; i < (sizeof(mem_block) / 8); i++) {
|
||||
mem_block[i] = vm::ps3::read64(address + (i * 8));
|
||||
}
|
||||
}
|
||||
|
||||
void Store(PPUThread & ppu) {
|
||||
for (int i = 0; i < 32; i++) {
|
||||
ppu.FPR[i] = FPR[i];
|
||||
ppu.GPR[i] = GPR[i];
|
||||
ppu.VPR[i] = VPR[i];
|
||||
|
||||
if (i < 8) {
|
||||
ppu.SPRG[i] = SPRG[i];
|
||||
}
|
||||
}
|
||||
|
||||
ppu.FPSCR = FPSCR;
|
||||
ppu.CR = CR;
|
||||
ppu.XER = XER;
|
||||
ppu.VSCR = VSCR;
|
||||
ppu.LR = LR;
|
||||
ppu.CTR = CTR;
|
||||
ppu.TB = TB;
|
||||
|
||||
for (int i = 0; i < (sizeof(mem_block) / 8); i++) {
|
||||
vm::ps3::write64(address + (i * 8), mem_block[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void SetRandom(u32 addr) {
|
||||
std::mt19937_64 rng;
|
||||
|
||||
rng.seed((u32)std::chrono::high_resolution_clock::now().time_since_epoch().count());
|
||||
for (int i = 0; i < 32; i++) {
|
||||
FPR[i] = (double)rng();
|
||||
GPR[i] = rng();
|
||||
VPR[i]._f[0] = (float)rng();
|
||||
VPR[i]._f[1] = (float)(rng() & 0x7FFFFFFF);
|
||||
VPR[i]._f[2] = -(float)(rng() & 0x7FFFFFFF);
|
||||
VPR[i]._f[3] = -(float)rng();
|
||||
|
||||
if (i < 8) {
|
||||
SPRG[i] = rng();
|
||||
}
|
||||
}
|
||||
|
||||
FPSCR.FPSCR = (u32)rng();
|
||||
CR.CR = (u32)rng();
|
||||
XER.XER = 0;
|
||||
XER.CA = (u32)rng();
|
||||
XER.SO = (u32)rng();
|
||||
XER.OV = (u32)rng();
|
||||
VSCR.VSCR = (u32)rng();
|
||||
VSCR.X = 0;
|
||||
VSCR.Y = 0;
|
||||
LR = rng();
|
||||
CTR = rng();
|
||||
TB = rng();
|
||||
|
||||
address = addr;
|
||||
for (int i = 0; i < (sizeof(mem_block) / 8); i++) {
|
||||
mem_block[i] = rng();
|
||||
}
|
||||
}
|
||||
|
||||
std::string ToString() const {
|
||||
std::string ret;
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
ret += fmt::format("GPR[%02d] = 0x%016llx FPR[%02d] = %16g (0x%016llx) VPR[%02d] = 0x%s [%s]\n", i, GPR[i], i, FPR[i]._double, FPR[i]._u64, i, VPR[i].to_hex().c_str(), VPR[i].to_xyzw().c_str());
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
ret += fmt::format("SPRG[%d] = 0x%016llx\n", i, SPRG[i]);
|
||||
}
|
||||
|
||||
ret += fmt::format("CR = 0x%08x LR = 0x%016llx CTR = 0x%016llx TB=0x%016llx\n", CR.CR, LR, CTR, TB);
|
||||
ret += fmt::format("XER = 0x%016llx [CA=%d | OV=%d | SO=%d]\n", XER.XER, u32{ XER.CA }, u32{ XER.OV }, u32{ XER.SO });
|
||||
|
||||
for (int i = 0; i < (sizeof(mem_block) / 8); i += 2) {
|
||||
// ret += fmt::format("mem_block[%d] = 0x%016llx mem_block[%d] = 0x%016llx\n", i, mem_block[i], i + 1, mem_block[i + 1]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
static std::string StateDiff(PPUState const & recomp, PPUState const & interp) {
|
||||
std::string ret;
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (recomp.GPR[i] != interp.GPR[i]) {
|
||||
ret += fmt::format("recomp: GPR[%02d] = 0x%016llx interp: GPR[%02d] = 0x%016llx\n", i, recomp.GPR[i], i, interp.GPR[i]);
|
||||
}
|
||||
if (recomp.FPR[i]._u64 != interp.FPR[i]._u64) {
|
||||
ret += fmt::format("recomp: FPR[%02d] = %16g (0x%016llx) interp: FPR[%02d] = %16g (0x%016llx)\n", i, recomp.FPR[i]._double, recomp.FPR[i]._u64, i, interp.FPR[i]._double, interp.FPR[i]._u64);
|
||||
}
|
||||
if (recomp.VPR[i] != interp.VPR[i]) {
|
||||
ret += fmt::format("recomp: VPR[%02d] = 0x%s [%s]\n", i, recomp.VPR[i].to_hex().c_str(), recomp.VPR[i].to_xyzw().c_str());
|
||||
ret += fmt::format("interp: VPR[%02d] = 0x%s [%s]\n", i, interp.VPR[i].to_hex().c_str(), interp.VPR[i].to_xyzw().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (recomp.SPRG[i] != interp.SPRG[i])
|
||||
ret += fmt::format("recomp: SPRG[%d] = 0x%016llx interp: SPRG[%d] = 0x%016llx\n", i, recomp.SPRG[i], i, interp.SPRG[i]);
|
||||
}
|
||||
|
||||
if (recomp.CR.CR != interp.CR.CR) {
|
||||
ret += fmt::format("recomp: CR = 0x%08x\n", recomp.CR.CR);
|
||||
ret += fmt::format("interp: CR = 0x%08x\n", interp.CR.CR);
|
||||
}
|
||||
if (recomp.LR != interp.LR) {
|
||||
ret += fmt::format("recomp: LR = 0x%016llx\n", recomp.LR);
|
||||
ret += fmt::format("interp: LR = 0x%016llx\n", interp.LR);
|
||||
}
|
||||
if (recomp.CTR != interp.CTR) {
|
||||
ret += fmt::format("recomp: CTR = 0x%016llx\n", recomp.CTR);
|
||||
ret += fmt::format("interp: CTR = 0x%016llx\n", interp.CTR);
|
||||
}
|
||||
if (recomp.TB != interp.TB) {
|
||||
ret += fmt::format("recomp: TB = 0x%016llx\n", recomp.TB);
|
||||
ret += fmt::format("interp: TB = 0x%016llx\n", interp.TB);
|
||||
}
|
||||
|
||||
if (recomp.XER.XER != interp.XER.XER) {
|
||||
ret += fmt::format("recomp: XER = 0x%016llx [CA=%d | OV=%d | SO=%d]\n", recomp.XER.XER, u32{ recomp.XER.CA }, u32{ recomp.XER.OV }, u32{ recomp.XER.SO });
|
||||
ret += fmt::format("interp: XER = 0x%016llx [CA=%d | OV=%d | SO=%d]\n", interp.XER.XER, u32{ interp.XER.CA }, u32{ interp.XER.OV }, u32{ interp.XER.SO });
|
||||
}
|
||||
|
||||
for (int i = 0; i < (sizeof(recomp.mem_block) / 8); i++) {
|
||||
if (recomp.mem_block[i] != interp.mem_block[i]) {
|
||||
ret += fmt::format("recomp: mem_block[%d] = 0x%016llx\n", i, recomp.mem_block[i]);
|
||||
ret += fmt::format("interp: mem_block[%d] = 0x%016llx\n", i, interp.mem_block[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class ppu_llvm_test_class;
|
||||
|
||||
class TestCompiler : public ppu_recompiler_llvm::Compiler
|
||||
{
|
||||
friend class ppu_llvm_test_class;
|
||||
TestCompiler(LLVMContext *ctx, IRBuilder<> *builder, std::unordered_map<std::string, void*> map) : Compiler(ctx, builder, map)
|
||||
{}
|
||||
public:
|
||||
template <class... Args>
|
||||
static std::pair<std::unique_ptr<llvm::ExecutionEngine>, Executable> build_test(void (Compiler::*recomp_fn)(Args...), Args... args)
|
||||
{
|
||||
LLVMContext &context(getGlobalContext());
|
||||
IRBuilder<> builder(getGlobalContext());
|
||||
std::unordered_map<std::string, void*> executable_map;
|
||||
|
||||
std::unique_ptr<llvm::Module> module = Compiler::create_module(context);
|
||||
|
||||
TestCompiler compiler(&context, &builder, executable_map);
|
||||
|
||||
compiler.m_module = module.get();
|
||||
compiler.initiate_function("test");
|
||||
auto block = BasicBlock::Create(context, "start", compiler.m_state.function);
|
||||
builder.SetInsertPoint(block);
|
||||
|
||||
(compiler.*recomp_fn)(args...);
|
||||
builder.CreateRet(builder.getInt32(0));
|
||||
|
||||
Compiler::optimise_module(module.get());
|
||||
llvm::Module *module_ptr = module.get();
|
||||
|
||||
llvm::ExecutionEngine *execution_engine =
|
||||
EngineBuilder(std::move(module))
|
||||
.setEngineKind(EngineKind::JIT)
|
||||
.setMCJITMemoryManager(std::unique_ptr<llvm::SectionMemoryManager>(new CustomSectionMemoryManager(executable_map)))
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setMCPU("nehalem")
|
||||
.create();
|
||||
module_ptr->setDataLayout(execution_engine->getDataLayout());
|
||||
|
||||
execution_engine->finalizeObject();
|
||||
|
||||
Function *llvm_function = module_ptr->getFunction("test");
|
||||
void *function = execution_engine->getPointerToFunction(llvm_function);
|
||||
|
||||
return std::make_pair(std::unique_ptr<llvm::ExecutionEngine>(execution_engine), (Executable)function);
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
template <class... Args>
|
||||
void verify_instruction_against_interpreter_using_random_inputs(int s, int n, void (Compiler::*recomp_fn)(Args...), void (PPUInterpreter::*interp_fn)(Args...), Args... args)
|
||||
{
|
||||
InitializeNativeTarget();
|
||||
InitializeNativeTargetAsmPrinter();
|
||||
InitializeNativeTargetDisassembler();
|
||||
|
||||
std::pair<std::unique_ptr<llvm::ExecutionEngine>, Executable> build_result = TestCompiler::template build_test(recomp_fn, args...);
|
||||
PPUState recomp_output_state;
|
||||
PPUState interp_output_state;
|
||||
|
||||
PPUThread * s_ppu_state = idm::make_ptr<PPUThread>("Test Thread").get();
|
||||
PPUInterpreter interpreter(*s_ppu_state);
|
||||
PPUInterpreter * s_interpreter = &interpreter;
|
||||
|
||||
Emu.SetTestMode();
|
||||
vm::ps3::init();
|
||||
u32 addr = vm::alloc(1024, vm::memory_location_t::main);
|
||||
|
||||
PPUState input;
|
||||
for (int i = s; i < (n + s); i++) {
|
||||
input.SetRandom(0x10000);
|
||||
|
||||
input.Store(*s_ppu_state);
|
||||
build_result.second(s_ppu_state, 0);
|
||||
recomp_output_state.Load(*s_ppu_state, addr);
|
||||
|
||||
input.Store(*s_ppu_state);
|
||||
(s_interpreter->*interp_fn)(args...);
|
||||
interp_output_state.Load(*s_ppu_state, addr);
|
||||
|
||||
Assert::AreEqual(interp_output_state.ToString(), recomp_output_state.ToString());
|
||||
}
|
||||
vm::dealloc(addr, vm::memory_location_t::main);
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
void verify_instruction_against_interpreter_using_determined_inputs(PPUState &input, void (Compiler::*recomp_fn)(Args...), void (PPUInterpreter::*interp_fn)(Args...), Args... args)
|
||||
{
|
||||
InitializeNativeTarget();
|
||||
InitializeNativeTargetAsmPrinter();
|
||||
InitializeNativeTargetDisassembler();
|
||||
|
||||
std::pair<std::unique_ptr<llvm::ExecutionEngine>, Executable> build_result = TestCompiler::template build_test(recomp_fn, args...);
|
||||
|
||||
Emu.SetTestMode();
|
||||
vm::ps3::init();
|
||||
u32 addr = vm::alloc(1024, vm::memory_location_t::main);
|
||||
|
||||
PPUState recomp_output_state;
|
||||
PPUState interp_output_state;
|
||||
|
||||
PPUThread * s_ppu_state = idm::make_ptr<PPUThread>("Test Thread").get();
|
||||
PPUInterpreter interpreter(*s_ppu_state);
|
||||
PPUInterpreter * s_interpreter = &interpreter;
|
||||
|
||||
input.Store(*s_ppu_state);
|
||||
build_result.second(s_ppu_state, 0);
|
||||
recomp_output_state.Load(*s_ppu_state, addr);
|
||||
|
||||
input.Store(*s_ppu_state);
|
||||
(s_interpreter->*interp_fn)(args...);
|
||||
interp_output_state.Load(*s_ppu_state, addr);
|
||||
|
||||
Assert::AreEqual(interp_output_state.ToString(), recomp_output_state.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#define VERIFY_INSTRUCTION_AGAINST_INTERPRETER_USING_RANDOM_INPUT(fn, s, n, ...) \
|
||||
|
||||
|
||||
#define TEST_INSTRUCTION_USING_RANDOM_INPUT(name, fn, s, n, ...) \
|
||||
TEST_METHOD(random_##name) \
|
||||
{ \
|
||||
verify_instruction_against_interpreter_using_random_inputs(s, n, &TestCompiler::fn, &PPUInterpreter::fn, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define TEST_INSTRUCTION_USING_DETERMINED_INPUT(name, fn, ...) \
|
||||
TEST_METHOD(name) \
|
||||
{ \
|
||||
PPUState input; \
|
||||
input.SetRandom(0x10000); \
|
||||
input.GPR[14] = 10; \
|
||||
input.GPR[21] = 15; \
|
||||
input.GPR[23] = 0x10000; \
|
||||
input.mem_block[0] = 0x8877665544332211; \
|
||||
input.GPR[1] = 9223372036854775807; \
|
||||
input.GPR[2] = 1; \
|
||||
input.GPR[3] = 0; \
|
||||
input.XER.XER = 0; \
|
||||
verify_instruction_against_interpreter_using_determined_inputs(input, &TestCompiler::fn, &PPUInterpreter::fn, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
TEST_CLASS(ppu_llvm_test_class)
|
||||
{
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFVSCR, MFVSCR, 0, 5, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTVSCR, MTVSCR, 0, 5, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDCUW, VADDCUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDFP, VADDFP,0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDSBS, VADDSBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDSHS, VADDSHS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDSWS, VADDSWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUBM, VADDUBM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUBS, VADDUBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUHM, VADDUHM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUHS, VADDUHS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUWM, VADDUWM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VADDUWS, VADDUWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAND, VAND, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VANDC, VANDC, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGSB, VAVGSB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGSH, VAVGSH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGSW, VAVGSW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGUB, VAVGUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGUH, VAVGUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VAVGUW, VAVGUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCFSX1, VCFSX, 0, 5, 0u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCFSX2, VCFSX, 5, 5, 0u, 3u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCFUX1, VCFUX, 0, 5, 0u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCFUX2, VCFUX, 5, 5, 0u, 2u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPBFP1, VCMPBFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPBFP2, VCMPBFP, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPBFP_1, VCMPBFP_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPBFP_2, VCMPBFP_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQFP1, VCMPEQFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQFP2, VCMPEQFP, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQFP_1, VCMPEQFP_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQFP_2, VCMPEQFP_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUB1, VCMPEQUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUB2, VCMPEQUB, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUB_1, VCMPEQUB_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUB_2, VCMPEQUB_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUH1, VCMPEQUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUH2, VCMPEQUH, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUH_1, VCMPEQUH_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUH_2, VCMPEQUH_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUW1, VCMPEQUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUW2, VCMPEQUW, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUW_1, VCMPEQUW_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPEQUW_2, VCMPEQUW_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGEFP1, VCMPGEFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGEFP2, VCMPGEFP, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGEFP_1, VCMPGEFP_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGEFP_2, VCMPGEFP_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTFP1, VCMPGTFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTFP2, VCMPGTFP, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTFP_1, VCMPGTFP_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTFP_2, VCMPGTFP_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSB1, VCMPGTSB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSB2, VCMPGTSB, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSB_1, VCMPGTSB_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSB_2, VCMPGTSB_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSH1, VCMPGTSH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSH2, VCMPGTSH, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSH_1, VCMPGTSH_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSH_2, VCMPGTSH_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSW1, VCMPGTSW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSW2, VCMPGTSW, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSW_1, VCMPGTSW_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTSW_2, VCMPGTSW_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUB1, VCMPGTUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUB2, VCMPGTUB, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUB_1, VCMPGTUB_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUB_2, VCMPGTUB_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUH1, VCMPGTUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUH2, VCMPGTUH, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUH_1, VCMPGTUH_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUH_2, VCMPGTUH_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUW1, VCMPGTUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUW2, VCMPGTUW, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUW_1, VCMPGTUW_, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCMPGTUW_2, VCMPGTUW_, 5, 5, 0u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCTSXS1, VCTSXS, 0, 5, 0u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCTSXS2, VCTSXS, 5, 5, 0u, 3u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCTUXS1, VCTUXS, 0, 5, 0u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VCTUXS2, VCTUXS, 5, 5, 0u, 3u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VEXPTEFP, VEXPTEFP, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VLOGEFP, VLOGEFP, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMADDFP, VMADDFP, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXFP, VMAXFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXSB, VMAXSB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXSH, VMAXSH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXSW, VMAXSW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXUB, VMAXUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXUH, VMAXUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMAXUW, VMAXUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMHADDSHS, VMHADDSHS, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMHRADDSHS, VMHRADDSHS, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINFP, VMINFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINSB, VMINSB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINSH, VMINSH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINSW, VMINSW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINUB, VMINUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINUH, VMINUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMINUW, VMINUW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMLADDUHM, VMLADDUHM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGHB, VMRGHB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGHH, VMRGHH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGHW, VMRGHW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGLB, VMRGLB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGLH, VMRGLH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMRGLW, VMRGLW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMMBM, VMSUMMBM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMSHM, VMSUMSHM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMSHS, VMSUMSHS, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMUBM, VMSUMUBM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMUHM, VMSUMUHM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMSUMUHS, VMSUMUHS, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULESB, VMULESB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULESH, VMULESH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULEUB, VMULEUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULEUH, VMULEUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULOSB, VMULOSB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULOSH, VMULOSH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULOUB, VMULOUB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VMULOUH, VMULOUH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VNMSUBFP, VNMSUBFP, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VNOR, VNOR, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VOR, VOR, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPERM, VPERM, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKPX, VPKPX, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKSHSS, VPKSHSS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKSHUS, VPKSHUS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKSWSS, VPKSWSS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKSWUS, VPKSWUS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKUHUM, VPKUHUM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKUHUS, VPKUHUS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKUWUM, VPKUWUM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VPKUWUS, VPKUWUS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VREFP, VREFP, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRFIM, VRFIM, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRFIN, VRFIN, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRFIP, VRFIP, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRFIZ, VRFIZ, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRLB, VRLB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRLH, VRLH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRLW, VRLW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VRSQRTEFP, VRSQRTEFP, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSEL, VSEL, 0, 5, 0u, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSL, VSL, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSLB, VSLB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSLDOI, VSLDOI, 0, 5, 0u, 1u, 2u, 6u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSLH, VSLH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSLO, VSLO, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSLW, VSLW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTB, VSPLTB, 0, 5, 0u, 3u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTH, VSPLTH, 0, 5, 0u, 3u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTISB, VSPLTISB, 0, 5, 0u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTISH, VSPLTISH, 0, 5, 0u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTISW, VSPLTISW, 0, 5, 0u, -12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSPLTW, VSPLTW, 0, 5, 0u, 3u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSR, VSR, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRAB, VSRAB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRAH, VSRAH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRAW, VSRAW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRB, VSRB, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRH, VSRH, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRO, VSRO, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSRW, VSRW, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBFP, VSUBFP, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBSBS, VSUBSBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBSHS, VSUBSHS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBSWS, VSUBSWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUBM, VSUBUBM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUBS, VSUBUBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUHM, VSUBUHM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUHS, VSUBUHS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUWM, VSUBUWM, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUBUWS, VSUBUWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUMSWS, VSUMSWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUM2SWS, VSUM2SWS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUM4SBS, VSUM4SBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUM4SHS, VSUM4SHS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VSUM4UBS, VSUM4UBS, 0, 5, 0u, 1u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKHPX, VUPKHPX, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKHSB, VUPKHSB, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKHSH, VUPKHSH, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKLPX, VUPKLPX, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKLSB, VUPKLSB, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VUPKLSH, VUPKLSH, 0, 5, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(VXOR, VXOR, 0, 5, 0u, 1u, 2u);
|
||||
// TODO: Rest of the vector instructions
|
||||
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULLI, MULLI, 0, 5, 1u, 2u, 12345);
|
||||
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC1, SUBFIC, 0, 5, 1u, 2u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC2, SUBFIC, 10, 5, 1u, 2u, -12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC3, SUBFIC, 15, 5, 1u, 2u, 32767);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC4, SUBFIC, 20, 5, 1u, 2u, -32767);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC5, SUBFIC, 25, 5, 1u, 2u, 0);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFIC6, SUBFIC, 30, 5, 0u, 1u, -1);
|
||||
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPLI1, CMPLI, 0, 5, 1u, 0u, 7u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPLI2, CMPLI, 5, 5, 1u, 1u, 7u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPI1, CMPI, 0, 5, 5u, 0u, 7u, -12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPI2, CMPI, 5, 5, 5u, 1u, 7u, -12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDIC, ADDIC, 0, 5, 1u, 2u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDIC_, ADDIC_, 0, 5, 1u, 2u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDI1, ADDI, 0, 5, 1u, 2u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDI2, ADDI, 5, 5, 0u, 2u, 12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDIS1, ADDIS, 0, 5, 1u, 2u, -12345);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDIS2, ADDIS, 5, 5, 0u, 2u, -12345);
|
||||
// TODO: BC
|
||||
// TODO: SC
|
||||
// TODO: B
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRF1, MCRF, 0, 5, 0u, 7u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRF2, MCRF, 5, 5, 6u, 2u);
|
||||
// TODO: BCLR
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRNOR, CRNOR, 0, 5, 0u, 7u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRANDC, CRANDC, 0, 5, 5u, 6u, 7u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ISYNC, ISYNC, 0, 5);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRXOR, CRXOR, 0, 5, 7u, 7u, 7u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRNAND, CRNAND, 0, 5, 3u, 4u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRAND, CRAND, 0, 5, 1u, 2u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CREQV, CREQV, 0, 5, 2u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CRORC, CRORC, 0, 5, 3u, 4u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CROR, CROR, 0, 5, 6u, 7u, 0u);
|
||||
// TODO: BCCTR
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWIMI1, RLWIMI, 0, 5, 7u, 8u, 9u, 12u, 25u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWIMI2, RLWIMI, 5, 5, 21u, 22u, 21u, 18u, 24u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWINM1, RLWINM, 0, 5, 7u, 8u, 9u, 12u, 25u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWINM2, RLWINM, 5, 5, 21u, 22u, 21u, 18u, 24u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWNM1, RLWNM, 0, 5, 7u, 8u, 9u, 12u, 25u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLWNM2, RLWNM, 5, 5, 21u, 22u, 21u, 18u, 24u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ORI, ORI, 0, 5, 25u, 29u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ORIS, ORIS, 0, 5, 7u, 31u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(XORI, XORI, 0, 5, 0u, 19u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(XORIS, XORIS, 0, 5, 3u, 14u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ANDI_, ANDI_, 0, 5, 16u, 7u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ANDIS_, ANDIS_, 0, 5, 23u, 21u, 12345u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDICL1, RLDICL, 0, 5, 7u, 8u, 9u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDICL2, RLDICL, 5, 5, 21u, 22u, 43u, 43u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDICR1, RLDICR, 0, 5, 7u, 8u, 0u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDICR2, RLDICR, 5, 5, 21u, 22u, 63u, 43u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDIC1, RLDIC, 0, 5, 7u, 8u, 9u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDIC2, RLDIC, 5, 5, 21u, 22u, 23u, 43u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDIMI1, RLDIMI, 0, 5, 7u, 8u, 9u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDIMI2, RLDIMI, 5, 5, 21u, 22u, 23u, 43u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDC_LR1, RLDC_LR, 0, 5, 7u, 8u, 9u, 12u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(RLDC_LR2, RLDC_LR, 5, 5, 21u, 22u, 23u, 43u, 1u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMP1, CMP, 0, 5, 3u, 0u, 9u, 31u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMP2, CMP, 5, 5, 6u, 1u, 23u, 14u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFC1, SUBFC, 0, 5, 0u, 1u, 2u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFC2, SUBFC, 5, 5, 0u, 1u, 2u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDC1, ADDC, 0, 5, 0u, 1u, 2u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDC2, ADDC, 5, 5, 0u, 1u, 2u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHDU1, MULHDU, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHDU2, MULHDU, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHWU1, MULHWU, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHWU2, MULHWU, 5, 5, 21u, 22u, 23u, 1u);
|
||||
// TODO: MFOCRF
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SLW1, SLW, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SLW2, SLW, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CNTLZW1, CNTLZW, 0, 5, 5u, 6u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CNTLZW2, CNTLZW, 5, 5, 5u, 6u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SLD1, SLD, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SLD2, SLD, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(AND1, AND, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(AND2, AND, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPL1, CMPL, 0, 5, 3u, 0u, 9u, 31u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CMPL2, CMPL, 5, 5, 6u, 1u, 23u, 14u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBF1, SUBF, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBF2, SUBF, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CNTLZD1, CNTLZD, 0, 5, 5u, 6u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(CNTLZD2, CNTLZD, 5, 5, 5u, 6u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ANDC1, ANDC, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ANDC2, ANDC, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHD1, MULHD, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHD2, MULHD, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHW1, MULHW, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULHW2, MULHW, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NEG1, NEG, 0, 5, 7u, 8u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NEG2, NEG, 5, 5, 21u, 22u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NOR1, NOR, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NOR2, NOR, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFE1, SUBFE, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFE2, SUBFE, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDE1, ADDE, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDE2, ADDE, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTOCRF1, MTOCRF, 0, 5, 7u, 8u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTOCRF2, MTOCRF, 5, 5, 0u, 22u, 1u)
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDZE1, ADDZE, 0, 5, 7u, 8u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDZE2, ADDZE, 5, 5, 21u, 22u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFZE1, SUBFZE, 0, 5, 7u, 8u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFZE2, SUBFZE, 5, 5, 21u, 22u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFME1, SUBFME, 0, 5, 7u, 8u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SUBFME2, SUBFME, 5, 5, 21u, 22u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULLD1, MULLD, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULLD2, MULLD, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDME1, ADDME, 0, 5, 7u, 8u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADDME2, ADDME, 5, 5, 21u, 22u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULLW1, MULLW, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MULLW2, MULLW, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADD1, ADD, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ADD2, ADD, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EQV1, EQV, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EQV2, EQV, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(XOR1, XOR, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(XOR2, XOR, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFSPR1, MFSPR, 0, 5, 5u, 0x20u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFSPR2, MFSPR, 5, 5, 5u, 0x100u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFSPR3, MFSPR, 10, 5, 5u, 0x120u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFSPR4, MFSPR, 15, 5, 5u, 0x8u);
|
||||
// TODO: MFTB
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ORC1, ORC, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(ORC2, ORC, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(OR1, OR, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(OR2, OR, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVDU1, DIVDU, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVDU2, DIVDU, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVWU1, DIVWU, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVWU2, DIVWU, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTSPR1, MTSPR, 0, 5, 0x20u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTSPR2, MTSPR, 5, 5, 0x100u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTSPR3, MTSPR, 10, 5, 0x120u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTSPR4, MTSPR, 15, 5, 0x8u, 5u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NAND1, NAND, 0, 5, 7u, 8u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(NAND2, NAND, 5, 5, 21u, 22u, 23u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVD1, DIVD, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVD2, DIVD, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVW1, DIVW, 0, 5, 7u, 8u, 9u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(DIVW2, DIVW, 5, 5, 21u, 22u, 23u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRW1, SRW, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRW2, SRW, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRD1, SRD, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRD2, SRD, 5, 5, 5u, 6u, 7u, 1u);
|
||||
// TODO: SYNC
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAW1, SRAW, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAW2, SRAW, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAD1, SRAD, 0, 5, 5u, 6u, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAD2, SRAD, 5, 5, 5u, 6u, 7u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAWI1, SRAWI, 0, 5, 5u, 6u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAWI2, SRAWI, 5, 5, 5u, 6u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAWI3, SRAWI, 10, 5, 5u, 6u, 22u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRAWI4, SRAWI, 15, 5, 5u, 6u, 31u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRADI11, SRADI1, 0, 5, 5u, 6u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRADI12, SRADI1, 5, 5, 5u, 6u, 12u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRADI13, SRADI1, 10, 5, 5u, 6u, 48u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(SRADI14, SRADI1, 15, 5, 5u, 6u, 63u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EIEIO, EIEIO, 0, 5);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSH1, EXTSH, 0, 5, 6u, 9u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSH2, EXTSH, 5, 5, 6u, 9u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSB1, EXTSB, 0, 5, 3u, 5u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSB2, EXTSB, 5, 5, 3u, 5u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSW1, EXTSW, 0, 5, 25u, 29u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(EXTSW2, EXTSW, 5, 5, 25u, 29u, 1u);
|
||||
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FDIVS, FDIVS, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FSUBS, FSUBS, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FADDS, FADDS, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FSQRTS, FSQRTS, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FRES, FRES, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMULS, FMULS, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMADDS, FMADDS, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMSUBS, FMSUBS, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNMSUBS, FNMSUBS, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNMADDS, FNMADDS, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB11, MTFSB1, 0, 5, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB12, MTFSB1, 5, 5, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB13, MTFSB1, 10, 5, 25u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB14, MTFSB1, 15, 5, 31u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRFS1, MCRFS, 0, 5, 0u, 7u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRFS2, MCRFS, 5, 5, 7u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRFS3, MCRFS, 10, 5, 5u, 2u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MCRFS4, MCRFS, 15, 5, 5u, 3u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB01, MTFSB0, 0, 5, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB02, MTFSB0, 5, 5, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB03, MTFSB0, 10, 5, 25u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSB04, MTFSB0, 15, 5, 31u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSFI1, MTFSFI, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSFI2, MTFSFI, 5, 5, 2u, 6u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSFI3, MTFSFI, 10, 5, 5u, 11u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSFI4, MTFSFI, 15, 5, 7u, 14u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MFFS, MFFS, 0, 5, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSF1, MTFSF, 0, 5, 0u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSF2, MTFSF, 5, 5, 2u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSF3, MTFSF, 10, 5, 5u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(MTFSF4, MTFSF, 15, 5, 7u, 0u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCMPU, FCMPU, 0, 5, 5u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FRSP, FRSP, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCTIW, FCTIW, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCTIWZ, FCTIWZ, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FDIV, FDIV, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FSUB, FSUB, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FADD, FADD, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FSQRT, FSQRT, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FSEL, FSEL, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMUL, FMUL, 0, 5, 0u, 1u, 2u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FRSQRTE, FRSQRTE, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMSUB, FMSUB, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMADD, FMADD, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNMSUB, FNMSUB, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNMADD, FNMADD, 0, 5, 0u, 1u, 2u, 3u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCMPO, FCMPO, 0, 5, 3u, 0u, 1u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNEG, FNEG, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FMR, FMR, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FNABS, FNABS, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FABS, FABS, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCTID1, FCTID, 0, 5, 0u, 1u, 0u);
|
||||
TEST_INSTRUCTION_USING_RANDOM_INPUT(FCFID2, FCTID, 0, 5, 0u, 1u, 0u);
|
||||
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC1, SUBFIC, 1u, 2u, -32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC2, SUBFIC, 1u, 2u, -1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC3, SUBFIC, 1u, 2u, 0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC4, SUBFIC, 1u, 1u, -32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC5, SUBFIC, 1u, 1u, -1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC6, SUBFIC, 1u, 1u, 0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC7, SUBFIC, 3u, 3u, -32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC8, SUBFIC, 3u, 3u, -1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC9, SUBFIC, 3u, 3u, 0);
|
||||
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC10, SUBFIC, 1u, 2u, 32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC11, SUBFIC, 1u, 2u, 1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC12, SUBFIC, 1u, 2u, 0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC13, SUBFIC, 1u, 1u, 32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC14, SUBFIC, 1u, 1u, 1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC15, SUBFIC, 1u, 1u, 0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC16, SUBFIC, 3u, 3u, 32767);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC17, SUBFIC, 3u, 3u, 1);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(SUBFIC18, SUBFIC, 3u, 3u, 0);
|
||||
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZ1, LBZ, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZ2, LBZ, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZU, LBZU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZX1, LBZX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZX2, LBZX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LBZUX, LBZUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZ1, LHZ, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZ2, LHZ, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZU, LHZU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZX1, LHZX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZX2, LHZX, 5u, 14u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(ECIWX, 0, 5u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(ECIWX, 1, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHZUX, LHZUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHA1, LHA, 5u, 0u, 0x100F0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHA2, LHA, 5u, 14u, 0x100F0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHAU, LHAU, 5u, 14u, 0x100F0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHAX1, LHAX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHAX2, LHAX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHAUX, LHAUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LHBRX, LHBRX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZ1, LWZ, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZ2, LWZ, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZU, LWZU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZX1, LWZX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZX2, LWZX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWZUX, LWZUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWA1, LWA, 5u, 0u, 0x100F0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWA2, LWA, 5u, 14u, 0x100F0);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWAX1, LWAX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWAX2, LWAX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWAUX, LWAUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWBRX, LWAUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LD1, LD, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LD2, LD, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDU, LDU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDX1, LDX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDX2, LDX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDUX, LDUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDBRX, LDBRX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFS1, LFS, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFS2, LFS, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFSU, LFSU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFSX1, LFSX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFSX2, LFSX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFSUX, LFSUX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFD1, LFD, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFD2, LFD, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFDU, LFDU, 5u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFDX1, LFDX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFDX2, LFDX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LFDUX, LFDUX, 5u, 14u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWARX, 0, 5u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(LWARX, 1, 5u, 14u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDARX, 0, 5u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(LDARX, 1, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LSWI1, LSWI, 5u, 23u, 0u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LSWI2, LSWI, 5u, 23u, 2u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LSWI3, LSWI, 5u, 23u, 7u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LSWI4, LSWI, 5u, 23u, 25u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LMW1, LMW, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LMW2, LMW, 16u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVX1, LVX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVX2, LVX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVXL1, LVXL, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVXL2, LVXL, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSL1, LVSL, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSL2, LVSL, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSL3, LVSL, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSR1, LVSR, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSR2, LVSR, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVSR3, LVSR, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEBX1, LVEBX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEBX2, LVEBX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEBX3, LVEBX, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEHX1, LVEHX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEHX2, LVEHX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEHX3, LVEHX, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEWX1, LVEWX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEWX2, LVEWX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVEWX3, LVEWX, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVLX1, LVLX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVLX2, LVLX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVLX3, LVLX, 5u, 21u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVRX1, LVRX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVRX2, LVRX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(LVRX3, LVRX, 5u, 21u, 23u);
|
||||
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STB1, STB, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STB2, STB, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STBU, STBU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDCX_, STDCX_, 3u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDCX_, 1, 3u, 14u, 23u); unhandled unknown exception, new
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STBX1, STBX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STBX2, STBX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STBUX, STBUX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STH1, STH, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STH2, STH, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STHU, STHU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STHX1, STHX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STHX2, STHX, 3u, 14u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(ECOWX, 0, 3u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(ECOWX, 1, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STHUX, STHUX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STHBRX, STHBRX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STW1, STW, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STW2, STW, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWU, STWU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWX1, STWX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWX2, STWX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWUX, STWUX, 3u, 14u, 23u);
|
||||
// TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVLX1, STVLX, 0u, 0u, 23u); // Crashes
|
||||
// TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVLX2, STVLX, 0u, 14u, 23u); // Crashes
|
||||
// TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVLX3, STVLX, 0u, 21u, 23u); // Crashes
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWBRX, STWBRX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STD1, STD, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STD2, STD, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDU, STDU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDX1, STDX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDX2, STDX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWCX_, STWCX_, 3u, 0u, 23u);
|
||||
//TEST_INSTRUCTION_USING_DETERMINED_INPUT(STWCX_, 1, 3u, 14u, 23u); unhandled unknown exception, new
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STDUX, STDUX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFS1, STFS, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFS2, STFS, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFSU, STFSU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFSX1, STFSX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFSX2, STFSX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVRX1, STVRX, 0u, 0u, 23u);
|
||||
// TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVRX2, STVRX, 0u, 14u, 23u); // Crashes
|
||||
// TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVRX3, STVRX, 0u, 21u, 23u); // Crashes
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFSUX, STFSUX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFD1, STFD, 3u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFD2, STFD, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFDU, STFDU, 3u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFDX1, STFDX, 3u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFDX2, STFDX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFDUX, STFDUX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STFIWX, STFIWX, 3u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVX1, STVX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVX2, STVX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVXL1, STVXL, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVXL2, STVXL, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEBX1, STVEBX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEBX2, STVEBX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEHX1, STVEHX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEHX2, STVEHX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEWX1, STVEWX, 5u, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STVEWX2, STVEWX, 5u, 14u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STMW1, STMW, 5u, 0u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STMW2, STMW, 16u, 14u, 0x10000);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STSWI1, STSWI, 5u, 23u, 0u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STSWI2, STSWI, 5u, 23u, 2u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STSWI3, STSWI, 5u, 23u, 7u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(STSWI4, STSWI, 5u, 23u, 25u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(DCBZ1, DCBZ, 0u, 23u);
|
||||
TEST_INSTRUCTION_USING_DETERMINED_INPUT(DCBZ2, DCBZ, 14u, 23u);
|
||||
};
|
@ -47,10 +47,12 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IncludePath>.\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include;$(UniversalCRT_IncludePath);..\minidx9\Include;..\minidx12\Include</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<IncludePath>.\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include;$(UniversalCRT_IncludePath);..\minidx9\Include;..\minidx12\Include</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
@ -92,6 +94,7 @@
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ps3_ppu_llvm.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
|
@ -14,6 +14,9 @@
|
||||
<ClCompile Include="ps3_syscall.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ps3_ppu_llvm.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
|
@ -101,10 +101,13 @@ namespace ppu_recompiler_llvm {
|
||||
class Compiler;
|
||||
}
|
||||
|
||||
class ppu_llvm_test_class;
|
||||
|
||||
class PPUInterpreter : public PPUOpcodes
|
||||
{
|
||||
#ifdef PPU_LLVM_RECOMPILER
|
||||
friend class ppu_recompiler_llvm::Compiler;
|
||||
friend class ppu_llvm_test_class;
|
||||
#endif
|
||||
private:
|
||||
PPUThread& CPU;
|
||||
|
@ -45,25 +45,62 @@ using namespace ppu_recompiler_llvm;
|
||||
u64 Compiler::s_rotate_mask[64][64];
|
||||
bool Compiler::s_rotate_mask_inited = false;
|
||||
|
||||
Compiler::Compiler(RecompilationEngine & recompilation_engine, const Executable execute_unknown_function,
|
||||
const Executable execute_unknown_block, bool(*poll_status_function)(PPUThread * ppu_state))
|
||||
: m_recompilation_engine(recompilation_engine)
|
||||
, m_poll_status_function(poll_status_function) {
|
||||
InitializeNativeTarget();
|
||||
InitializeNativeTargetAsmPrinter();
|
||||
InitializeNativeTargetDisassembler();
|
||||
std::unique_ptr<Module> Compiler::create_module(LLVMContext &llvm_context)
|
||||
{
|
||||
const std::vector<Type *> arg_types = { Type::getInt8PtrTy(llvm_context), Type::getInt64Ty(llvm_context) };
|
||||
FunctionType *compiled_function_type = FunctionType::get(Type::getInt32Ty(llvm_context), arg_types, false);
|
||||
|
||||
m_llvm_context = new LLVMContext();
|
||||
m_ir_builder = new IRBuilder<>(*m_llvm_context);
|
||||
std::unique_ptr<llvm::Module> result(new llvm::Module("Module", llvm_context));
|
||||
Function *execute_unknown_function = (Function *)result->getOrInsertFunction("execute_unknown_function", compiled_function_type);
|
||||
execute_unknown_function->setCallingConv(CallingConv::X86_64_Win64);
|
||||
|
||||
Function *execute_unknown_block = (Function *)result->getOrInsertFunction("execute_unknown_block", compiled_function_type);
|
||||
execute_unknown_block->setCallingConv(CallingConv::X86_64_Win64);
|
||||
|
||||
std::string targetTriple = "x86_64-pc-windows-elf";
|
||||
result->setTargetTriple(targetTriple);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void Compiler::optimise_module(llvm::Module *module)
|
||||
{
|
||||
llvm::FunctionPassManager fpm(module);
|
||||
fpm.add(createNoAAPass());
|
||||
fpm.add(createBasicAliasAnalysisPass());
|
||||
fpm.add(createNoTargetTransformInfoPass());
|
||||
fpm.add(createEarlyCSEPass());
|
||||
fpm.add(createTailCallEliminationPass());
|
||||
fpm.add(createReassociatePass());
|
||||
fpm.add(createInstructionCombiningPass());
|
||||
fpm.add(new DominatorTreeWrapperPass());
|
||||
fpm.add(new MemoryDependenceAnalysis());
|
||||
fpm.add(createGVNPass());
|
||||
fpm.add(createInstructionCombiningPass());
|
||||
fpm.add(new MemoryDependenceAnalysis());
|
||||
fpm.add(createDeadStoreEliminationPass());
|
||||
fpm.add(new LoopInfo());
|
||||
fpm.add(new ScalarEvolution());
|
||||
fpm.add(createSLPVectorizerPass());
|
||||
fpm.add(createInstructionCombiningPass());
|
||||
fpm.add(createCFGSimplificationPass());
|
||||
fpm.doInitialization();
|
||||
|
||||
for (auto I = module->begin(), E = module->end(); I != E; ++I)
|
||||
fpm.run(*I);
|
||||
}
|
||||
|
||||
|
||||
Compiler::Compiler(LLVMContext *context, llvm::IRBuilder<> *builder, std::unordered_map<std::string, void*> &function_ptrs)
|
||||
: m_llvm_context(context),
|
||||
m_ir_builder(builder),
|
||||
m_executable_map(function_ptrs) {
|
||||
|
||||
std::vector<Type *> arg_types;
|
||||
arg_types.push_back(m_ir_builder->getInt8PtrTy());
|
||||
arg_types.push_back(m_ir_builder->getInt64Ty());
|
||||
m_compiled_function_type = FunctionType::get(m_ir_builder->getInt32Ty(), arg_types, false);
|
||||
|
||||
m_executableMap["execute_unknown_function"] = execute_unknown_function;
|
||||
m_executableMap["execute_unknown_block"] = execute_unknown_block;
|
||||
|
||||
if (!s_rotate_mask_inited) {
|
||||
InitRotateMask();
|
||||
s_rotate_mask_inited = true;
|
||||
@ -71,54 +108,10 @@ Compiler::Compiler(RecompilationEngine & recompilation_engine, const Executable
|
||||
}
|
||||
|
||||
Compiler::~Compiler() {
|
||||
delete m_ir_builder;
|
||||
delete m_llvm_context;
|
||||
}
|
||||
|
||||
std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::string & name, u32 start_address, u32 instruction_count) {
|
||||
auto compilation_start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
m_module = new llvm::Module("Module", *m_llvm_context);
|
||||
m_execute_unknown_function = (Function *)m_module->getOrInsertFunction("execute_unknown_function", m_compiled_function_type);
|
||||
m_execute_unknown_function->setCallingConv(CallingConv::X86_64_Win64);
|
||||
|
||||
m_execute_unknown_block = (Function *)m_module->getOrInsertFunction("execute_unknown_block", m_compiled_function_type);
|
||||
m_execute_unknown_block->setCallingConv(CallingConv::X86_64_Win64);
|
||||
|
||||
std::string targetTriple = "x86_64-pc-windows-elf";
|
||||
m_module->setTargetTriple(targetTriple);
|
||||
|
||||
llvm::ExecutionEngine *execution_engine =
|
||||
EngineBuilder(std::unique_ptr<llvm::Module>(m_module))
|
||||
.setEngineKind(EngineKind::JIT)
|
||||
.setMCJITMemoryManager(std::unique_ptr<llvm::SectionMemoryManager>(new CustomSectionMemoryManager(m_executableMap)))
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setMCPU("nehalem")
|
||||
.create();
|
||||
m_module->setDataLayout(execution_engine->getDataLayout());
|
||||
|
||||
llvm::FunctionPassManager *fpm = new llvm::FunctionPassManager(m_module);
|
||||
fpm->add(createNoAAPass());
|
||||
fpm->add(createBasicAliasAnalysisPass());
|
||||
fpm->add(createNoTargetTransformInfoPass());
|
||||
fpm->add(createEarlyCSEPass());
|
||||
fpm->add(createTailCallEliminationPass());
|
||||
fpm->add(createReassociatePass());
|
||||
fpm->add(createInstructionCombiningPass());
|
||||
fpm->add(new DominatorTreeWrapperPass());
|
||||
fpm->add(new MemoryDependenceAnalysis());
|
||||
fpm->add(createGVNPass());
|
||||
fpm->add(createInstructionCombiningPass());
|
||||
fpm->add(new MemoryDependenceAnalysis());
|
||||
fpm->add(createDeadStoreEliminationPass());
|
||||
fpm->add(new LoopInfo());
|
||||
fpm->add(new ScalarEvolution());
|
||||
fpm->add(createSLPVectorizerPass());
|
||||
fpm->add(createInstructionCombiningPass());
|
||||
fpm->add(createCFGSimplificationPass());
|
||||
fpm->doInitialization();
|
||||
|
||||
// Create the function
|
||||
void Compiler::initiate_function(const std::string &name)
|
||||
{
|
||||
m_state.function = (Function *)m_module->getOrInsertFunction(name, m_compiled_function_type);
|
||||
m_state.function->setCallingConv(CallingConv::X86_64_Win64);
|
||||
auto arg_i = m_state.function->arg_begin();
|
||||
@ -126,6 +119,16 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||
m_state.args[CompileTaskState::Args::State] = arg_i;
|
||||
(++arg_i)->setName("context");
|
||||
m_state.args[CompileTaskState::Args::Context] = arg_i;
|
||||
}
|
||||
|
||||
void ppu_recompiler_llvm::Compiler::translate_to_llvm_ir(llvm::Module *module, const std::string & name, u32 start_address, u32 instruction_count)
|
||||
{
|
||||
m_module = module;
|
||||
|
||||
m_execute_unknown_function = module->getFunction("execute_unknown_function");
|
||||
m_execute_unknown_block = module->getFunction("execute_unknown_block");
|
||||
|
||||
initiate_function(name);
|
||||
|
||||
// Create the entry block and add code to branch to the first instruction
|
||||
m_ir_builder->SetInsertPoint(GetBasicBlockFromAddress(0));
|
||||
@ -135,7 +138,7 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||
PPUDisAsm dis_asm(CPUDisAsm_DumpMode);
|
||||
dis_asm.offset = vm::ps3::_ptr<u8>(start_address);
|
||||
|
||||
m_recompilation_engine.Log() << "Recompiling block :\n\n";
|
||||
// m_recompilation_engine.Log() << "Recompiling block :\n\n";
|
||||
|
||||
// Convert each instruction in the CFG to LLVM IR
|
||||
std::vector<PHINode *> exit_instr_list;
|
||||
@ -150,7 +153,7 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||
// Dump PPU opcode
|
||||
dis_asm.dump_pc = instructionAddress;
|
||||
(*PPU_instr::main_list)(&dis_asm, instr);
|
||||
m_recompilation_engine.Log() << dis_asm.last_opcode;
|
||||
// m_recompilation_engine.Log() << dis_asm.last_opcode;
|
||||
|
||||
Decode(instr);
|
||||
if (!m_state.hit_branch_instruction)
|
||||
@ -194,51 +197,17 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||
}
|
||||
}
|
||||
|
||||
m_recompilation_engine.Log() << "LLVM bytecode:\n";
|
||||
m_recompilation_engine.Log() << *m_module;
|
||||
// m_recompilation_engine.Log() << "LLVM bytecode:\n";
|
||||
// m_recompilation_engine.Log() << *m_module;
|
||||
|
||||
std::string verify;
|
||||
raw_string_ostream verify_ostream(verify);
|
||||
if (verifyFunction(*m_state.function, &verify_ostream)) {
|
||||
m_recompilation_engine.Log() << "Verification failed: " << verify_ostream.str() << "\n";
|
||||
// m_recompilation_engine.Log() << "Verification failed: " << verify_ostream.str() << "\n";
|
||||
}
|
||||
|
||||
auto ir_build_end = std::chrono::high_resolution_clock::now();
|
||||
m_stats.ir_build_time += std::chrono::duration_cast<std::chrono::nanoseconds>(ir_build_end - compilation_start);
|
||||
|
||||
// Optimize this function
|
||||
fpm->run(*m_state.function);
|
||||
auto optimize_end = std::chrono::high_resolution_clock::now();
|
||||
m_stats.optimization_time += std::chrono::duration_cast<std::chrono::nanoseconds>(optimize_end - ir_build_end);
|
||||
|
||||
// Translate to machine code
|
||||
execution_engine->finalizeObject();
|
||||
void *function = execution_engine->getPointerToFunction(m_state.function);
|
||||
auto translate_end = std::chrono::high_resolution_clock::now();
|
||||
m_stats.translation_time += std::chrono::duration_cast<std::chrono::nanoseconds>(translate_end - optimize_end);
|
||||
|
||||
/* m_recompilation_engine.Log() << "\nDisassembly:\n";
|
||||
auto disassembler = LLVMCreateDisasm(sys::getProcessTriple().c_str(), nullptr, 0, nullptr, nullptr);
|
||||
for (size_t pc = 0; pc < mci.size();) {
|
||||
char str[1024];
|
||||
|
||||
auto size = LLVMDisasmInstruction(disassembler, ((u8 *)mci.address()) + pc, mci.size() - pc, (uint64_t)(((u8 *)mci.address()) + pc), str, sizeof(str));
|
||||
m_recompilation_engine.Log() << fmt::format("0x%08X: ", (u64)(((u8 *)mci.address()) + pc)) << str << '\n';
|
||||
pc += size;
|
||||
}
|
||||
|
||||
LLVMDisasmDispose(disassembler);*/
|
||||
|
||||
auto compilation_end = std::chrono::high_resolution_clock::now();
|
||||
m_stats.total_time += std::chrono::duration_cast<std::chrono::nanoseconds>(compilation_end - compilation_start);
|
||||
delete fpm;
|
||||
|
||||
assert(function != nullptr);
|
||||
return std::make_pair((Executable)function, execution_engine);
|
||||
}
|
||||
|
||||
Compiler::Stats Compiler::GetStats() {
|
||||
return m_stats;
|
||||
m_module = nullptr;
|
||||
m_state.function = nullptr;
|
||||
}
|
||||
|
||||
void Compiler::Decode(const u32 code) {
|
||||
@ -252,13 +221,16 @@ RecompilationEngine::RecompilationEngine()
|
||||
: m_log(nullptr)
|
||||
, m_currentId(0)
|
||||
, m_last_cache_clear_time(std::chrono::high_resolution_clock::now())
|
||||
, m_compiler(*this, CPUHybridDecoderRecompiler::ExecuteFunction, CPUHybridDecoderRecompiler::ExecuteTillReturn, CPUHybridDecoderRecompiler::PollStatus) {
|
||||
, m_llvm_context(getGlobalContext())
|
||||
, m_ir_builder(getGlobalContext()) {
|
||||
InitializeNativeTarget();
|
||||
InitializeNativeTargetAsmPrinter();
|
||||
InitializeNativeTargetDisassembler();
|
||||
|
||||
FunctionCache = (ExecutableStorageType *)memory_helper::reserve_memory(VIRTUAL_INSTRUCTION_COUNT * sizeof(ExecutableStorageType));
|
||||
// Each char can store 8 page status
|
||||
FunctionCachePagesCommited = (char *)malloc(VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
||||
memset(FunctionCachePagesCommited, 0, VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
||||
|
||||
m_compiler.RunAllTests();
|
||||
}
|
||||
|
||||
RecompilationEngine::~RecompilationEngine() {
|
||||
@ -352,20 +324,6 @@ void RecompilationEngine::on_task() {
|
||||
}
|
||||
}
|
||||
|
||||
std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now();
|
||||
auto total_time = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start);
|
||||
auto compiler_stats = m_compiler.GetStats();
|
||||
|
||||
Log() << "Total time = " << total_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent compiling = " << compiler_stats.total_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent building IR = " << compiler_stats.ir_build_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent optimizing = " << compiler_stats.optimization_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent translating = " << compiler_stats.translation_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent recompiling = " << recompiling_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent idling = " << idling_time.count() / 1000000 << "ms\n";
|
||||
Log() << " Time spent doing misc tasks = " << (total_time.count() - idling_time.count() - compiler_stats.total_time.count()) / 1000000 << "ms\n";
|
||||
|
||||
LOG_NOTICE(PPU, "PPU LLVM Recompilation thread exiting.");
|
||||
s_the_instance = nullptr; // Can cause deadlock if this is the last instance. Need to fix this.
|
||||
}
|
||||
|
||||
@ -384,6 +342,92 @@ bool RecompilationEngine::IncreaseHitCounterAndBuild(u32 address) {
|
||||
return false;
|
||||
}
|
||||
|
||||
extern void execute_ppu_func_by_index(PPUThread& ppu, u32 id);
|
||||
extern void execute_syscall_by_index(PPUThread& ppu, u64 code);
|
||||
|
||||
static u32
|
||||
wrappedExecutePPUFuncByIndex(PPUThread &CPU, u32 index) noexcept {
|
||||
try
|
||||
{
|
||||
execute_ppu_func_by_index(CPU, index);
|
||||
return ExecutionStatus::ExecutionStatusBlockEnded;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CPU.pending_exception = std::current_exception();
|
||||
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 wrappedDoSyscall(PPUThread &CPU, u64 code) noexcept {
|
||||
try
|
||||
{
|
||||
execute_syscall_by_index(CPU, code);
|
||||
return ExecutionStatus::ExecutionStatusBlockEnded;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CPU.pending_exception = std::current_exception();
|
||||
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||
}
|
||||
}
|
||||
|
||||
static void wrapped_fast_stop(PPUThread &CPU)
|
||||
{
|
||||
CPU.fast_stop();
|
||||
}
|
||||
|
||||
std::pair<Executable, llvm::ExecutionEngine *> RecompilationEngine::compile(const std::string & name, u32 start_address, u32 instruction_count) {
|
||||
std::unique_ptr<llvm::Module> module = Compiler::create_module(m_llvm_context);
|
||||
|
||||
std::unordered_map<std::string, void*> function_ptrs;
|
||||
function_ptrs["execute_unknown_function"] = reinterpret_cast<void*>(CPUHybridDecoderRecompiler::ExecuteFunction);
|
||||
function_ptrs["execute_unknown_block"] = reinterpret_cast<void*>(CPUHybridDecoderRecompiler::ExecuteTillReturn);
|
||||
function_ptrs["PollStatus"] = reinterpret_cast<void*>(CPUHybridDecoderRecompiler::PollStatus);
|
||||
function_ptrs["PPUThread.fast_stop"] = reinterpret_cast<void*>(wrapped_fast_stop);
|
||||
function_ptrs["vm.reservation_acquire"] = reinterpret_cast<void*>(vm::reservation_acquire);
|
||||
function_ptrs["vm.reservation_update"] = reinterpret_cast<void*>(vm::reservation_update);
|
||||
function_ptrs["get_timebased_time"] = reinterpret_cast<void*>(get_timebased_time);
|
||||
function_ptrs["wrappedExecutePPUFuncByIndex"] = reinterpret_cast<void*>(wrappedExecutePPUFuncByIndex);
|
||||
function_ptrs["wrappedDoSyscall"] = reinterpret_cast<void*>(wrappedDoSyscall);
|
||||
|
||||
Compiler(&m_llvm_context, &m_ir_builder, function_ptrs)
|
||||
.translate_to_llvm_ir(module.get(), name, start_address, instruction_count);
|
||||
Compiler::optimise_module(module.get());
|
||||
llvm::Module *module_ptr = module.get();
|
||||
|
||||
|
||||
llvm::ExecutionEngine *execution_engine =
|
||||
EngineBuilder(std::move(module))
|
||||
.setEngineKind(EngineKind::JIT)
|
||||
.setMCJITMemoryManager(std::unique_ptr<llvm::SectionMemoryManager>(new CustomSectionMemoryManager(function_ptrs)))
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setMCPU("nehalem")
|
||||
.create();
|
||||
module_ptr->setDataLayout(execution_engine->getDataLayout());
|
||||
|
||||
// Translate to machine code
|
||||
execution_engine->finalizeObject();
|
||||
|
||||
Function *llvm_function = module_ptr->getFunction(name);
|
||||
void *function = execution_engine->getPointerToFunction(llvm_function);
|
||||
|
||||
/* m_recompilation_engine.Log() << "\nDisassembly:\n";
|
||||
auto disassembler = LLVMCreateDisasm(sys::getProcessTriple().c_str(), nullptr, 0, nullptr, nullptr);
|
||||
for (size_t pc = 0; pc < mci.size();) {
|
||||
char str[1024];
|
||||
|
||||
auto size = LLVMDisasmInstruction(disassembler, ((u8 *)mci.address()) + pc, mci.size() - pc, (uint64_t)(((u8 *)mci.address()) + pc), str, sizeof(str));
|
||||
m_recompilation_engine.Log() << fmt::format("0x%08X: ", (u64)(((u8 *)mci.address()) + pc)) << str << '\n';
|
||||
pc += size;
|
||||
}
|
||||
|
||||
LLVMDisasmDispose(disassembler);*/
|
||||
|
||||
assert(function != nullptr);
|
||||
return std::make_pair((Executable)function, execution_engine);
|
||||
}
|
||||
|
||||
/**
|
||||
* This code is inspired from Dolphin PPC Analyst
|
||||
*/
|
||||
@ -466,7 +510,7 @@ void RecompilationEngine::CompileBlock(BlockEntry & block_entry) {
|
||||
std::unique_lock<std::mutex> lock(local_mutex);
|
||||
|
||||
const std::pair<Executable, llvm::ExecutionEngine *> &compileResult =
|
||||
m_compiler.Compile(fmt::format("fn_0x%08X", block_entry.address), block_entry.address, block_entry.instructionCount);
|
||||
compile(fmt::format("fn_0x%08X", block_entry.address), block_entry.address, block_entry.instructionCount);
|
||||
|
||||
if (!isAddressCommited(block_entry.address / 4))
|
||||
commitAddress(block_entry.address / 4);
|
||||
|
@ -46,41 +46,22 @@ namespace ppu_recompiler_llvm {
|
||||
/// Pointer to an executable
|
||||
typedef u32(*Executable)(PPUThread * ppu_state, u64 context);
|
||||
|
||||
/// PPU compiler that uses LLVM for code generation and optimization
|
||||
/// Parses PPU opcodes and translate them into llvm ir.
|
||||
class Compiler : protected PPUOpcodes, protected PPCDecoder {
|
||||
public:
|
||||
struct Stats {
|
||||
/// Time spent building the LLVM IR
|
||||
std::chrono::nanoseconds ir_build_time;
|
||||
|
||||
/// Time spent optimizing
|
||||
std::chrono::nanoseconds optimization_time;
|
||||
|
||||
/// Time spent translating LLVM IR to machine code
|
||||
std::chrono::nanoseconds translation_time;
|
||||
|
||||
/// Total time
|
||||
std::chrono::nanoseconds total_time;
|
||||
};
|
||||
|
||||
Compiler(RecompilationEngine & recompilation_engine, const Executable execute_unknown_function,
|
||||
const Executable execute_unknown_block, bool(*poll_status_function)(PPUThread * ppu_state));
|
||||
Compiler(llvm::LLVMContext *context, llvm::IRBuilder<> *builder, std::unordered_map<std::string, void*> &function_ptrs);
|
||||
|
||||
Compiler(const Compiler&) = delete; // Delete copy/move constructors and copy/move operators
|
||||
|
||||
virtual ~Compiler();
|
||||
|
||||
/**
|
||||
* Compile a code fragment described by a cfg and return an executable and the ExecutionEngine storing it
|
||||
* Pointer to function can be retrieved with getPointerToFunction
|
||||
*/
|
||||
std::pair<Executable, llvm::ExecutionEngine *> Compile(const std::string & name, u32 start_address, u32 instruction_count);
|
||||
/// Create a module setting target triples and some callbacks
|
||||
static std::unique_ptr<llvm::Module> create_module(llvm::LLVMContext &llvm_context);
|
||||
|
||||
/// Retrieve compiler stats
|
||||
Stats GetStats();
|
||||
/// Create a function called name in module and populates it by translating block at start_address with instruction_count length.
|
||||
void translate_to_llvm_ir(llvm::Module *module, const std::string & name, u32 start_address, u32 instruction_count);
|
||||
|
||||
/// Execute all tests
|
||||
void RunAllTests();
|
||||
static void optimise_module(llvm::Module *module);
|
||||
|
||||
protected:
|
||||
void Decode(const u32 code) override;
|
||||
@ -487,7 +468,10 @@ namespace ppu_recompiler_llvm {
|
||||
|
||||
void UNK(const u32 code, const u32 opcode, const u32 gcode) override;
|
||||
|
||||
private:
|
||||
/// Utility function creating a function called name with Executable signature
|
||||
void initiate_function(const std::string &name);
|
||||
|
||||
protected:
|
||||
/// State of a compilation task
|
||||
struct CompileTaskState {
|
||||
enum Args {
|
||||
@ -511,12 +495,6 @@ namespace ppu_recompiler_llvm {
|
||||
bool hit_branch_instruction;
|
||||
};
|
||||
|
||||
/// Recompilation engine
|
||||
RecompilationEngine & m_recompilation_engine;
|
||||
|
||||
/// The function that should be called to check the status of the thread
|
||||
bool(*m_poll_status_function)(PPUThread * ppu_state);
|
||||
|
||||
/// The function that will be called to execute unknown functions
|
||||
llvm::Function * m_execute_unknown_function;
|
||||
|
||||
@ -524,7 +502,7 @@ namespace ppu_recompiler_llvm {
|
||||
llvm::Function * m_execute_unknown_block;
|
||||
|
||||
/// Maps function name to executable memory pointer
|
||||
std::unordered_map<std::string, Executable> m_executableMap;
|
||||
std::unordered_map<std::string, void*> &m_executable_map;
|
||||
|
||||
/// LLVM context
|
||||
llvm::LLVMContext * m_llvm_context;
|
||||
@ -541,9 +519,6 @@ namespace ppu_recompiler_llvm {
|
||||
/// State of the current compilation task
|
||||
CompileTaskState m_state;
|
||||
|
||||
/// Compiler stats
|
||||
Stats m_stats;
|
||||
|
||||
/// Get the name of the basic block for the specified address
|
||||
std::string GetBasicBlockNameFromAddress(u32 address, const std::string & suffix = "") const;
|
||||
|
||||
@ -729,29 +704,22 @@ namespace ppu_recompiler_llvm {
|
||||
}
|
||||
|
||||
/// Call a function
|
||||
template<class ReturnType, class Func, class... Args>
|
||||
llvm::Value * Call(const char * name, Func function, Args... args) {
|
||||
template<class ReturnType, class... Args>
|
||||
llvm::Value * Call(const char * name, Args... args) {
|
||||
auto fn = m_module->getFunction(name);
|
||||
if (!fn) {
|
||||
std::vector<llvm::Type *> fn_args_type = { args->getType()... };
|
||||
auto fn_type = llvm::FunctionType::get(CppToLlvmType<ReturnType>(), fn_args_type, false);
|
||||
fn = llvm::cast<llvm::Function>(m_module->getOrInsertFunction(name, fn_type));
|
||||
fn->setCallingConv(llvm::CallingConv::X86_64_Win64);
|
||||
// Note: not threadsafe
|
||||
m_executableMap[name] = (Executable)(void *&)function;
|
||||
// Create an entry in m_executable_map that will be populated outside of compiler
|
||||
(void)m_executable_map[name];
|
||||
}
|
||||
|
||||
std::vector<llvm::Value *> fn_args = { args... };
|
||||
return m_ir_builder->CreateCall(fn, fn_args);
|
||||
}
|
||||
|
||||
/// Test an instruction against the interpreter
|
||||
template <class... Args>
|
||||
void VerifyInstructionAgainstInterpreter(const char * name, void (Compiler::*recomp_fn)(Args...), void (PPUInterpreter::*interp_fn)(Args...), PPUState & input_state, Args... args);
|
||||
|
||||
/// Excute a test
|
||||
void RunTest(const char * name, std::function<void()> test_case, std::function<void()> input, std::function<bool(std::string & msg)> check_result);
|
||||
|
||||
/// Handle compilation errors
|
||||
void CompilationError(const std::string & error);
|
||||
|
||||
@ -873,12 +841,22 @@ namespace ppu_recompiler_llvm {
|
||||
/// vector storing all exec engine
|
||||
std::vector<std::unique_ptr<llvm::ExecutionEngine> > m_executable_storage;
|
||||
|
||||
|
||||
/// LLVM context
|
||||
llvm::LLVMContext &m_llvm_context;
|
||||
|
||||
/// LLVM IR builder
|
||||
llvm::IRBuilder<> m_ir_builder;
|
||||
|
||||
/**
|
||||
* Compile a code fragment described by a cfg and return an executable and the ExecutionEngine storing it
|
||||
* Pointer to function can be retrieved with getPointerToFunction
|
||||
*/
|
||||
std::pair<Executable, llvm::ExecutionEngine *> compile(const std::string & name, u32 start_address, u32 instruction_count);
|
||||
|
||||
/// The time at which the m_address_to_ordinal cache was last cleared
|
||||
std::chrono::high_resolution_clock::time_point m_last_cache_clear_time;
|
||||
|
||||
/// PPU Compiler
|
||||
Compiler m_compiler;
|
||||
|
||||
RecompilationEngine();
|
||||
|
||||
RecompilationEngine(const RecompilationEngine&) = delete; // Delete copy/move constructors and copy/move operators
|
||||
@ -947,16 +925,16 @@ namespace ppu_recompiler_llvm {
|
||||
|
||||
class CustomSectionMemoryManager : public llvm::SectionMemoryManager {
|
||||
private:
|
||||
std::unordered_map<std::string, Executable> &executableMap;
|
||||
std::unordered_map<std::string, void*> &executableMap;
|
||||
public:
|
||||
CustomSectionMemoryManager(std::unordered_map<std::string, Executable> &map) :
|
||||
CustomSectionMemoryManager(std::unordered_map<std::string, void*> &map) :
|
||||
executableMap(map)
|
||||
{}
|
||||
~CustomSectionMemoryManager() override {}
|
||||
|
||||
virtual uint64_t getSymbolAddress(const std::string &Name) override
|
||||
{
|
||||
std::unordered_map<std::string, Executable>::const_iterator It = executableMap.find(Name);
|
||||
std::unordered_map<std::string, void*>::const_iterator It = executableMap.find(Name);
|
||||
if (It != executableMap.end())
|
||||
return (uint64_t)It->second;
|
||||
return getSymbolAddressInProcess(Name);
|
||||
|
@ -29,9 +29,6 @@
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
extern void execute_ppu_func_by_index(PPUThread& ppu, u32 id);
|
||||
extern void execute_syscall_by_index(PPUThread& ppu, u64 code);
|
||||
|
||||
using namespace llvm;
|
||||
using namespace ppu_recompiler_llvm;
|
||||
|
||||
@ -1755,24 +1752,8 @@ void Compiler::BC(u32 bo, u32 bi, s32 bd, u32 aa, u32 lk) {
|
||||
CreateBranch(CheckBranchCondition(bo, bi), target_i32, lk ? true : false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static u32
|
||||
wrappedExecutePPUFuncByIndex(PPUThread &CPU, u32 index) noexcept {
|
||||
try
|
||||
{
|
||||
execute_ppu_func_by_index(CPU, index);
|
||||
return ExecutionStatus::ExecutionStatusBlockEnded;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CPU.pending_exception = std::current_exception();
|
||||
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||
}
|
||||
}
|
||||
|
||||
void Compiler::HACK(u32 index) {
|
||||
llvm::Value *status = Call<u32>("wrappedExecutePPUFuncByIndex", &wrappedExecutePPUFuncByIndex, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index & EIF_USE_BRANCH ? index : index & ~EIF_PERFORM_BLR));
|
||||
llvm::Value *status = Call<u32>("wrappedExecutePPUFuncByIndex", m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index & EIF_USE_BRANCH ? index : index & ~EIF_PERFORM_BLR));
|
||||
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(status, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||
llvm::BasicBlock *normal_execution = GetBasicBlockFromAddress(m_state.current_instruction_address, "normal_execution");
|
||||
@ -1787,24 +1768,11 @@ void Compiler::HACK(u32 index) {
|
||||
}
|
||||
}
|
||||
|
||||
static u32 wrappedDoSyscall(PPUThread &CPU, u64 code) noexcept {
|
||||
try
|
||||
{
|
||||
execute_syscall_by_index(CPU, code);
|
||||
return ExecutionStatus::ExecutionStatusBlockEnded;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CPU.pending_exception = std::current_exception();
|
||||
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||
}
|
||||
}
|
||||
|
||||
void Compiler::SC(u32 lev) {
|
||||
switch (lev) {
|
||||
case 0:
|
||||
{
|
||||
llvm::Value *status = Call<u32>("wrappedDoSyscall", &wrappedDoSyscall, m_state.args[CompileTaskState::Args::State], GetGpr(11));
|
||||
llvm::Value *status = Call<u32>("wrappedDoSyscall", m_state.args[CompileTaskState::Args::State], GetGpr(11));
|
||||
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(status, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||
llvm::BasicBlock *normal_execution = GetBasicBlockFromAddress(m_state.current_instruction_address, "normal_execution");
|
||||
@ -1815,14 +1783,14 @@ void Compiler::SC(u32 lev) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
Call<void>("PPUThread.fast_stop", &PPUThread::fast_stop, m_state.args[CompileTaskState::Args::State]);
|
||||
Call<void>("PPUThread.fast_stop", m_state.args[CompileTaskState::Args::State]);
|
||||
break;
|
||||
default:
|
||||
CompilationError(fmt::format("SC %u", lev));
|
||||
break;
|
||||
}
|
||||
|
||||
auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
|
||||
auto ret_i1 = Call<bool>("PollStatus", m_state.args[CompileTaskState::Args::State]);
|
||||
auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
|
||||
auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
|
||||
auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
||||
@ -2293,7 +2261,7 @@ void Compiler::LWARX(u32 rd, u32 ra, u32 rb) {
|
||||
auto addr_i32 = m_ir_builder->CreateTrunc(addr_i64, m_ir_builder->getInt32Ty());
|
||||
auto val_i32_ptr = m_ir_builder->CreateAlloca(m_ir_builder->getInt32Ty());
|
||||
val_i32_ptr->setAlignment(4);
|
||||
Call<bool>("vm.reservation_acquire", vm::reservation_acquire, m_ir_builder->CreateBitCast(val_i32_ptr, m_ir_builder->getInt8PtrTy()), addr_i32, m_ir_builder->getInt32(4));
|
||||
Call<bool>("vm.reservation_acquire", m_ir_builder->CreateBitCast(val_i32_ptr, m_ir_builder->getInt8PtrTy()), addr_i32, m_ir_builder->getInt32(4));
|
||||
auto val_i32 = (Value *)m_ir_builder->CreateLoad(val_i32_ptr);
|
||||
val_i32 = m_ir_builder->CreateCall(Intrinsic::getDeclaration(m_module, Intrinsic::bswap, m_ir_builder->getInt32Ty()), val_i32);
|
||||
auto val_i64 = m_ir_builder->CreateZExt(val_i32, m_ir_builder->getInt64Ty());
|
||||
@ -2565,7 +2533,7 @@ void Compiler::LDARX(u32 rd, u32 ra, u32 rb) {
|
||||
auto addr_i32 = m_ir_builder->CreateTrunc(addr_i64, m_ir_builder->getInt32Ty());
|
||||
auto val_i64_ptr = m_ir_builder->CreateAlloca(m_ir_builder->getInt64Ty());
|
||||
val_i64_ptr->setAlignment(8);
|
||||
Call<bool>("vm.reservation_acquire", vm::reservation_acquire, m_ir_builder->CreateBitCast(val_i64_ptr, m_ir_builder->getInt8PtrTy()), addr_i32, m_ir_builder->getInt32(8));
|
||||
Call<bool>("vm.reservation_acquire", m_ir_builder->CreateBitCast(val_i64_ptr, m_ir_builder->getInt8PtrTy()), addr_i32, m_ir_builder->getInt32(8));
|
||||
auto val_i64 = (Value *)m_ir_builder->CreateLoad(val_i64_ptr);
|
||||
val_i64 = m_ir_builder->CreateCall(Intrinsic::getDeclaration(m_module, Intrinsic::bswap, m_ir_builder->getInt64Ty()), val_i64);
|
||||
SetGpr(rd, val_i64);
|
||||
@ -2744,7 +2712,7 @@ void Compiler::STWCX_(u32 rs, u32 ra, u32 rb) {
|
||||
auto rs_i32_ptr = m_ir_builder->CreateAlloca(m_ir_builder->getInt32Ty());
|
||||
rs_i32_ptr->setAlignment(4);
|
||||
m_ir_builder->CreateStore(rs_i32, rs_i32_ptr);
|
||||
auto success_i1 = Call<bool>("vm.reservation_update", vm::reservation_update, addr_i32, m_ir_builder->CreateBitCast(rs_i32_ptr, m_ir_builder->getInt8PtrTy()), m_ir_builder->getInt32(4));
|
||||
auto success_i1 = Call<bool>("vm.reservation_update", addr_i32, m_ir_builder->CreateBitCast(rs_i32_ptr, m_ir_builder->getInt8PtrTy()), m_ir_builder->getInt32(4));
|
||||
|
||||
auto cr_i32 = GetCr();
|
||||
cr_i32 = SetBit(cr_i32, 2, success_i1);
|
||||
@ -2863,7 +2831,7 @@ void Compiler::STDCX_(u32 rs, u32 ra, u32 rb) {
|
||||
auto rs_i64_ptr = m_ir_builder->CreateAlloca(m_ir_builder->getInt64Ty());
|
||||
rs_i64_ptr->setAlignment(8);
|
||||
m_ir_builder->CreateStore(rs_i64, rs_i64_ptr);
|
||||
auto success_i1 = Call<bool>("vm.reservation_update", vm::reservation_update, addr_i32, m_ir_builder->CreateBitCast(rs_i64_ptr, m_ir_builder->getInt8PtrTy()), m_ir_builder->getInt32(8));
|
||||
auto success_i1 = Call<bool>("vm.reservation_update", addr_i32, m_ir_builder->CreateBitCast(rs_i64_ptr, m_ir_builder->getInt8PtrTy()), m_ir_builder->getInt32(8));
|
||||
|
||||
auto cr_i32 = GetCr();
|
||||
cr_i32 = SetBit(cr_i32, 2, success_i1);
|
||||
@ -3084,10 +3052,10 @@ void Compiler::MFSPR(u32 rd, u32 spr) {
|
||||
rd_i64 = GetVrsave();
|
||||
break;
|
||||
case 0x10C:
|
||||
rd_i64 = Call<u64>("get_timebased_time", get_timebased_time);
|
||||
rd_i64 = Call<u64>("get_timebased_time");
|
||||
break;
|
||||
case 0x10D:
|
||||
rd_i64 = Call<u64>("get_timebased_time", get_timebased_time);
|
||||
rd_i64 = Call<u64>("get_timebased_time");
|
||||
rd_i64 = m_ir_builder->CreateLShr(rd_i64, 32);
|
||||
break;
|
||||
default:
|
||||
@ -3132,7 +3100,7 @@ void Compiler::LVXL(u32 vd, u32 ra, u32 rb) {
|
||||
}
|
||||
|
||||
void Compiler::MFTB(u32 rd, u32 spr) {
|
||||
auto tb_i64 = Call<u64>("get_timebased_time", get_timebased_time);
|
||||
auto tb_i64 = Call<u64>("get_timebased_time");
|
||||
|
||||
u32 n = (spr >> 5) | ((spr & 0x1f) << 5);
|
||||
if (n == 0x10D) {
|
||||
@ -5244,7 +5212,7 @@ void Compiler::CreateBranch(llvm::Value * cmp_i1, llvm::Value * target_i32, bool
|
||||
// if (fn)
|
||||
// execStatus = m_ir_builder->CreateCall2(fn, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||
// else
|
||||
execStatus = Call<u32>("execute_unknown_function", nullptr, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||
execStatus = Call<u32>("execute_unknown_function", m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||
|
||||
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(execStatus, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -121,7 +121,7 @@ public:
|
||||
|
||||
void SendDbgCommand(DbgCommand cmd, class CPUThread* thread = nullptr)
|
||||
{
|
||||
m_cb.send_dbg_command(cmd, thread);
|
||||
if (m_cb.send_dbg_command) m_cb.send_dbg_command(cmd, thread);
|
||||
}
|
||||
|
||||
// Returns a future object associated with the result of the function called from the GUI thread
|
||||
@ -151,6 +151,14 @@ public:
|
||||
return future;
|
||||
}
|
||||
|
||||
/** Set emulator mode to running unconditionnaly.
|
||||
* Required to execute various part (PPUInterpreter, memory manager...) outside of rpcs3.
|
||||
*/
|
||||
void SetTestMode()
|
||||
{
|
||||
m_status = Running;
|
||||
}
|
||||
|
||||
void Init();
|
||||
void SetPath(const std::string& path, const std::string& elf_path = "");
|
||||
void SetTitleID(const std::string& id);
|
||||
|
@ -156,11 +156,6 @@
|
||||
<ClCompile Include="Emu\Audio\XAudio2\XAudio2Thread.cpp" />
|
||||
<ClCompile Include="Emu\Cell\MFC.cpp" />
|
||||
<ClCompile Include="Emu\Cell\PPCDecoder.cpp" />
|
||||
<ClCompile Include="Emu\Cell\PPULLVMRecompilerTests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\Cell\PPUThread.cpp" />
|
||||
<ClCompile Include="Emu\Cell\RawSPUThread.cpp" />
|
||||
<ClCompile Include="Emu\Cell\SPURecompiler.cpp" />
|
||||
|
@ -530,9 +530,6 @@
|
||||
<ClCompile Include="Emu\Cell\PPULLVMRecompiler.cpp">
|
||||
<Filter>Emu\CPU\Cell</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\Cell\PPULLVMRecompilerTests.cpp">
|
||||
<Filter>Emu\CPU\Cell</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\ARMv7\ARMv7Interpreter.cpp">
|
||||
<Filter>Emu\CPU\ARMv7</Filter>
|
||||
</ClCompile>
|
||||
|
Loading…
Reference in New Issue
Block a user