Hack to make Symbian build.

This commit is contained in:
Unknown W. Brackets 2016-05-13 20:17:20 -07:00
parent b7224e269c
commit efc8a8e353
5 changed files with 39 additions and 7 deletions

View File

@ -31,8 +31,6 @@
#include "Core/MIPS/IR/IRFrontend.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Common/Arm64Emitter.h"
#define _RS MIPS_GET_RS(op)
#define _RT MIPS_GET_RT(op)
#define _RD MIPS_GET_RD(op)

View File

@ -261,7 +261,7 @@ void IRFrontend::DoJit(u32 em_address, std::vector<IRInst> &instructions, std::v
ILOG("=============== Original IR (%d instructions, %d const) ===============", (int)ir.GetInstructions().size(), (int)ir.GetConstants().size());
for (size_t i = 0; i < ir.GetInstructions().size(); i++) {
char buf[256];
DisassembleIR(buf, sizeof(buf), ir.GetInstructions()[i], ir.GetConstants().data());
DisassembleIR(buf, sizeof(buf), ir.GetInstructions()[i], &ir.GetConstants()[0]);
ILOG("%s", buf);
}
ILOG("=============== end =================");
@ -271,7 +271,7 @@ void IRFrontend::DoJit(u32 em_address, std::vector<IRInst> &instructions, std::v
ILOG("=============== IR (%d instructions, %d const) ===============", (int)code->GetInstructions().size(), (int)code->GetConstants().size());
for (size_t i = 0; i < code->GetInstructions().size(); i++) {
char buf[256];
DisassembleIR(buf, sizeof(buf), code->GetInstructions()[i], code->GetConstants().data());
DisassembleIR(buf, sizeof(buf), code->GetInstructions()[i], &code->GetConstants()[0]);
ILOG("%s", buf);
}
ILOG("=============== end =================");

View File

@ -6,6 +6,16 @@
#include "Common/CommonTypes.h"
#include "Core/MIPS/MIPS.h"
#ifdef __SYMBIAN32__
// Seems std::move() doesn't exist, so assuming it can't do moves at all.
namespace std {
template <typename T>
const T &move(const T &x) {
return x;
}
};
#endif
// Basic IR
//
// This IR refers implicitly to the MIPS register set and is simple to interpret.

View File

@ -19,6 +19,7 @@
#include <cstring>
#include "Common/Common.h"
#include "Common/CPUDetect.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
@ -49,6 +50,31 @@ public:
b.const_ = nullptr;
}
IRBlock(const IRBlock &b) {
*this = b;
}
IRBlock &operator=(const IRBlock &b) {
// No std::move on Symbian... But let's try not to use elsewhere.
#ifndef __SYMBIAN32__
_assert_(false);
#endif
numInstructions_ = b.numInstructions_;
numConstants_ = b.numConstants_;
instr_ = new IRInst[numInstructions_];
if (numInstructions_) {
memcpy(instr_, b.instr_, sizeof(IRInst) * numInstructions_);
}
const_ = new u32[numConstants_];
if (numConstants_) {
memcpy(const_, b.const_, sizeof(u32) * numConstants_);
}
origAddr_ = b.origAddr_;
origFirstOpcode_ = b.origFirstOpcode_;
return *this;
}
~IRBlock() {
delete[] instr_;
delete[] const_;

View File

@ -102,7 +102,6 @@ bool OptimizeFPMoves(const IRWriter &in, IRWriter &out) {
//FMovToGPR a0, f12
//FMov f14, f12
const u32 *constants = in.GetConstants().data();
bool logBlocks = false;
IRInst prev;
prev.op = IROp::Nop;
@ -134,7 +133,6 @@ bool OptimizeFPMoves(const IRWriter &in, IRWriter &out) {
// Might be useful later on x86.
bool ThreeOpToTwoOp(const IRWriter &in, IRWriter &out) {
const u32 *constants = in.GetConstants().data();
bool logBlocks = false;
for (int i = 0; i < (int)in.GetInstructions().size(); i++) {
IRInst inst = in.GetInstructions()[i];
@ -178,7 +176,7 @@ bool ThreeOpToTwoOp(const IRWriter &in, IRWriter &out) {
bool PropagateConstants(const IRWriter &in, IRWriter &out) {
IRRegCache gpr(&out);
const u32 *constants = in.GetConstants().data();
const u32 *constants = &in.GetConstants()[0];
bool logBlocks = false;
for (int i = 0; i < (int)in.GetInstructions().size(); i++) {
IRInst inst = in.GetInstructions()[i];