Moving cpu/frontend/ppc/ to cpu/frontend/.
This commit is contained in:
parent
9281d62106
commit
3279776a80
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/frontend.h"
|
||||
|
||||
#include "xenia/cpu/runtime.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
|
||||
Frontend::Frontend(Runtime* runtime) : runtime_(runtime) {}
|
||||
|
||||
Frontend::~Frontend() = default;
|
||||
|
||||
Memory* Frontend::memory() const { return runtime_->memory(); }
|
||||
|
||||
int Frontend::Initialize() { return 0; }
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -1,55 +0,0 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_FRONTEND_H_
|
||||
#define XENIA_FRONTEND_FRONTEND_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "xenia/cpu/frontend/context_info.h"
|
||||
#include "xenia/memory.h"
|
||||
#include "xenia/cpu/function.h"
|
||||
#include "xenia/cpu/symbol_info.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
class Runtime;
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
|
||||
class Frontend {
|
||||
public:
|
||||
Frontend(Runtime* runtime);
|
||||
virtual ~Frontend();
|
||||
|
||||
Runtime* runtime() const { return runtime_; }
|
||||
Memory* memory() const;
|
||||
ContextInfo* context_info() const { return context_info_.get(); }
|
||||
|
||||
virtual int Initialize();
|
||||
|
||||
virtual int DeclareFunction(FunctionInfo* symbol_info) = 0;
|
||||
virtual int DefineFunction(FunctionInfo* symbol_info,
|
||||
uint32_t debug_info_flags, uint32_t trace_flags,
|
||||
Function** out_function) = 0;
|
||||
|
||||
protected:
|
||||
Runtime* runtime_;
|
||||
std::unique_ptr<ContextInfo> context_info_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_FRONTEND_H_
|
|
@ -1,30 +0,0 @@
|
|||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'sources': [
|
||||
'ppc_context.cc',
|
||||
'ppc_context.h',
|
||||
'ppc_disasm.cc',
|
||||
'ppc_disasm.h',
|
||||
'ppc_emit-private.h',
|
||||
'ppc_emit.h',
|
||||
'ppc_emit_altivec.cc',
|
||||
'ppc_emit_alu.cc',
|
||||
'ppc_emit_control.cc',
|
||||
'ppc_emit_fpu.cc',
|
||||
'ppc_emit_memory.cc',
|
||||
'ppc_frontend.cc',
|
||||
'ppc_frontend.h',
|
||||
'ppc_hir_builder.cc',
|
||||
'ppc_hir_builder.h',
|
||||
'ppc_instr.cc',
|
||||
'ppc_instr.h',
|
||||
'ppc_instr_tables.h',
|
||||
'ppc_scanner.cc',
|
||||
'ppc_scanner.h',
|
||||
'ppc_translator.cc',
|
||||
'ppc_translator.h',
|
||||
],
|
||||
|
||||
'includes': [
|
||||
],
|
||||
}
|
|
@ -7,14 +7,13 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
uint64_t ParseInt64(const char* value) {
|
||||
return std::strtoull(value, nullptr, 0);
|
||||
|
@ -82,7 +81,6 @@ bool PPCContext::CompareRegWithString(const char* name, const char* value,
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_CONTEXT_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_CONTEXT_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_CONTEXT_H_
|
||||
#define XENIA_FRONTEND_PPC_CONTEXT_H_
|
||||
|
||||
#include "poly/poly.h"
|
||||
#include "poly/vec128.h"
|
||||
|
@ -23,7 +23,6 @@ class ThreadState;
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
using vec128_t = poly::vec128_t;
|
||||
|
||||
|
@ -217,9 +216,8 @@ typedef struct alignas(64) PPCContext_s {
|
|||
} PPCContext;
|
||||
#pragma pack(pop)
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_CONTEXT_H_
|
||||
#endif // XENIA_FRONTEND_PPC_CONTEXT_H_
|
|
@ -7,7 +7,7 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc_disasm.h"
|
||||
|
||||
#include "poly/poly.h"
|
||||
#include "poly/string_buffer.h"
|
||||
|
@ -15,7 +15,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
void Disasm_0(InstrData& i, poly::StringBuffer* str) {
|
||||
str->Append("%-8s ???", i.type->name);
|
||||
|
@ -499,7 +498,6 @@ int DisasmPPC(InstrData& i, poly::StringBuffer* str) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,22 +7,20 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_DISASM_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_DISASM_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_DISASM_H_
|
||||
#define XENIA_FRONTEND_PPC_DISASM_H_
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
#include "poly/string_buffer.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
int DisasmPPC(InstrData& i, poly::StringBuffer* str);
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_DISASM_H_
|
||||
#endif // XENIA_FRONTEND_PPC_DISASM_H_
|
|
@ -7,16 +7,15 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_EMIT_PRIVATE_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_EMIT_PRIVATE_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_EMIT_PRIVATE_H_
|
||||
#define XENIA_FRONTEND_PPC_EMIT_PRIVATE_H_
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
#define XEEMITTER(name, opcode, format) int InstrEmit_##name
|
||||
|
||||
|
@ -27,9 +26,8 @@ namespace ppc {
|
|||
#define XEINSTRNOTIMPLEMENTED() assert_always("Instruction not implemented");
|
||||
//#define XEINSTRNOTIMPLEMENTED() __debugbreak()
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_EMIT_PRIVATE_H_
|
||||
#endif // XENIA_FRONTEND_PPC_EMIT_PRIVATE_H_
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_EMIT_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_EMIT_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_EMIT_H_
|
||||
#define XENIA_FRONTEND_PPC_EMIT_H_
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
void RegisterEmitCategoryAltivec();
|
||||
void RegisterEmitCategoryALU();
|
||||
|
@ -23,9 +22,8 @@ void RegisterEmitCategoryControl();
|
|||
void RegisterEmitCategoryFPU();
|
||||
void RegisterEmitCategoryMemory();
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_EMIT_H_
|
||||
#endif // XENIA_FRONTEND_PPC_EMIT_H_
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit-private.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit-private.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -2408,7 +2407,6 @@ void RegisterEmitCategoryAltivec() {
|
|||
XEREGISTERINSTR(vxor128, VX128(5, 784));
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit-private.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit-private.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -1270,7 +1269,6 @@ void RegisterEmitCategoryALU() {
|
|||
XEREGISTERINSTR(srawix, 0x7C000670);
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit-private.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit-private.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -748,7 +747,6 @@ void RegisterEmitCategoryControl() {
|
|||
XEREGISTERINSTR(mtmsrd, 0x7C000164);
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit-private.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit-private.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -553,7 +552,6 @@ void RegisterEmitCategoryFPU() {
|
|||
XEREGISTERINSTR(fnegx, 0xFC000050);
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,15 +7,14 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit-private.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit-private.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -1082,7 +1081,6 @@ void RegisterEmitCategoryMemory() {
|
|||
XEREGISTERINSTR(icbi, 0x7C0007AC);
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,18 +7,17 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc_frontend.h"
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_emit.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_translator.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc_emit.h"
|
||||
#include "xenia/cpu/frontend/ppc_translator.h"
|
||||
#include "xenia/cpu/runtime.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
using xe::cpu::Runtime;
|
||||
|
||||
|
@ -43,7 +42,7 @@ void InitializeIfNeeded() {
|
|||
|
||||
void CleanupOnShutdown() {}
|
||||
|
||||
PPCFrontend::PPCFrontend(Runtime* runtime) : Frontend(runtime) {
|
||||
PPCFrontend::PPCFrontend(Runtime* runtime) : runtime_(runtime) {
|
||||
InitializeIfNeeded();
|
||||
|
||||
std::unique_ptr<ContextInfo> context_info(
|
||||
|
@ -58,6 +57,8 @@ PPCFrontend::~PPCFrontend() {
|
|||
translator_pool_.Reset();
|
||||
}
|
||||
|
||||
Memory* PPCFrontend::memory() const { return runtime_->memory(); }
|
||||
|
||||
void CheckGlobalLock(PPCContext* ppc_state, void* arg0, void* arg1) {
|
||||
ppc_state->scratch = 0x8000;
|
||||
}
|
||||
|
@ -75,11 +76,6 @@ void HandleGlobalLock(PPCContext* ppc_state, void* arg0, void* arg1) {
|
|||
}
|
||||
|
||||
int PPCFrontend::Initialize() {
|
||||
int result = Frontend::Initialize();
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void* arg0 = reinterpret_cast<void*>(&builtins_.global_lock);
|
||||
void* arg1 = reinterpret_cast<void*>(&builtins_.global_lock_taken);
|
||||
builtins_.check_global_lock = runtime_->DefineBuiltin(
|
||||
|
@ -89,7 +85,7 @@ int PPCFrontend::Initialize() {
|
|||
"HandleGlobalLock", (FunctionInfo::ExternHandler)HandleGlobalLock, arg0,
|
||||
arg1);
|
||||
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PPCFrontend::DeclareFunction(FunctionInfo* symbol_info) {
|
||||
|
@ -111,7 +107,6 @@ int PPCFrontend::DefineFunction(FunctionInfo* symbol_info,
|
|||
return result;
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,18 +7,27 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_FRONTEND_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_FRONTEND_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_FRONTEND_H_
|
||||
#define XENIA_FRONTEND_PPC_FRONTEND_H_
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#include "xenia/cpu/frontend/frontend.h"
|
||||
#include "poly/type_pool.h"
|
||||
#include "xenia/cpu/frontend/context_info.h"
|
||||
#include "xenia/memory.h"
|
||||
#include "xenia/cpu/function.h"
|
||||
#include "xenia/cpu/symbol_info.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
class Runtime;
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
class PPCTranslator;
|
||||
|
||||
|
@ -29,27 +38,31 @@ struct PPCBuiltins {
|
|||
FunctionInfo* handle_global_lock;
|
||||
};
|
||||
|
||||
class PPCFrontend : public Frontend {
|
||||
class PPCFrontend {
|
||||
public:
|
||||
PPCFrontend(Runtime* runtime);
|
||||
~PPCFrontend() override;
|
||||
explicit PPCFrontend(Runtime* runtime);
|
||||
~PPCFrontend();
|
||||
|
||||
int Initialize() override;
|
||||
int Initialize();
|
||||
|
||||
Runtime* runtime() const { return runtime_; }
|
||||
Memory* memory() const;
|
||||
ContextInfo* context_info() const { return context_info_.get(); }
|
||||
PPCBuiltins* builtins() { return &builtins_; }
|
||||
|
||||
int DeclareFunction(FunctionInfo* symbol_info) override;
|
||||
int DeclareFunction(FunctionInfo* symbol_info);
|
||||
int DefineFunction(FunctionInfo* symbol_info, uint32_t debug_info_flags,
|
||||
uint32_t trace_flags, Function** out_function) override;
|
||||
uint32_t trace_flags, Function** out_function);
|
||||
|
||||
private:
|
||||
poly::TypePool<PPCTranslator, PPCFrontend*> translator_pool_;
|
||||
Runtime* runtime_;
|
||||
std::unique_ptr<ContextInfo> context_info_;
|
||||
PPCBuiltins builtins_;
|
||||
poly::TypePool<PPCTranslator, PPCFrontend*> translator_pool_;
|
||||
};
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_FRONTEND_H_
|
||||
#endif // XENIA_FRONTEND_PPC_FRONTEND_H_
|
|
@ -7,13 +7,13 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
|
||||
#include "xenia/cpu/cpu-private.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_context.h"
|
||||
#include "xenia/cpu/frontend/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
#include "xenia/cpu/hir/label.h"
|
||||
#include "xenia/cpu/runtime.h"
|
||||
#include "xenia/profiling.h"
|
||||
|
@ -21,7 +21,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu::hir;
|
||||
|
@ -490,7 +489,6 @@ Value* PPCHIRBuilder::StoreRelease(Value* address, Value* value,
|
|||
return eq;
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_HIR_BUILDER_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_HIR_BUILDER_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_HIR_BUILDER_H_
|
||||
#define XENIA_FRONTEND_PPC_HIR_BUILDER_H_
|
||||
|
||||
#include "xenia/cpu/hir/hir_builder.h"
|
||||
#include "xenia/cpu/function.h"
|
||||
|
@ -18,7 +18,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
class PPCFrontend;
|
||||
|
||||
|
@ -112,9 +111,8 @@ class PPCHIRBuilder : public hir::HIRBuilder {
|
|||
} trace_info_;
|
||||
};
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_HIR_BUILDER_H_
|
||||
#endif // XENIA_FRONTEND_PPC_HIR_BUILDER_H_
|
|
@ -7,19 +7,18 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr_tables.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr_tables.h"
|
||||
#include "poly/poly.h"
|
||||
#include "poly/string_buffer.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
std::vector<InstrType*> all_instrs_;
|
||||
|
||||
|
@ -402,7 +401,6 @@ int RegisterInstrEmit(uint32_t code, InstrEmitFn emit) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_INSTR_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_INSTR_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_INSTR_H_
|
||||
#define XENIA_FRONTEND_PPC_INSTR_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
@ -19,7 +19,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
inline uint32_t make_bitmask(uint32_t a, uint32_t b) {
|
||||
return (static_cast<uint32_t>(-1) >> (31 - b)) & ~((1u << a) - 1);
|
||||
|
@ -569,9 +568,8 @@ void DumpAllInstrCounts();
|
|||
InstrType* GetInstrType(uint32_t code);
|
||||
int RegisterInstrEmit(uint32_t code, InstrEmitFn emit);
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_INSTR_H_
|
||||
#endif // XENIA_FRONTEND_PPC_INSTR_H_
|
|
@ -7,19 +7,18 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_INSTR_TABLES_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_INSTR_TABLES_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_INSTR_TABLES_H_
|
||||
#define XENIA_FRONTEND_PPC_INSTR_TABLES_H_
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
#include "poly/poly.h"
|
||||
#include "poly/string_buffer.h"
|
||||
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
void Disasm_0(InstrData& i, poly::StringBuffer* str);
|
||||
void Disasm__(InstrData& i, poly::StringBuffer* str);
|
||||
|
@ -1094,9 +1093,8 @@ static InstrType instr_table_scan[] = {
|
|||
#undef EMPTY
|
||||
|
||||
} // namespace tables
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_INSTR_TABLES_H_
|
||||
#endif // XENIA_FRONTEND_PPC_INSTR_TABLES_H_
|
|
@ -7,13 +7,13 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_scanner.h"
|
||||
#include "xenia/cpu/frontend/ppc_scanner.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
#include "xenia/cpu/runtime.h"
|
||||
#include "poly/logging.h"
|
||||
#include "poly/memory.h"
|
||||
|
@ -28,7 +28,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
PPCScanner::PPCScanner(PPCFrontend* frontend) : frontend_(frontend) {}
|
||||
|
||||
|
@ -357,7 +356,6 @@ std::vector<BlockInfo> PPCScanner::FindBlocks(FunctionInfo* symbol_info) {
|
|||
return blocks;
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_SCANNER_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_SCANNER_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_SCANNER_H_
|
||||
#define XENIA_FRONTEND_PPC_SCANNER_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
class PPCFrontend;
|
||||
|
||||
|
@ -42,9 +41,8 @@ class PPCScanner {
|
|||
PPCFrontend* frontend_;
|
||||
};
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_SCANNER_H_
|
||||
#endif // XENIA_FRONTEND_PPC_SCANNER_H_
|
|
@ -7,15 +7,15 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/cpu/frontend/ppc/ppc_translator.h"
|
||||
#include "xenia/cpu/frontend/ppc_translator.h"
|
||||
|
||||
#include "xenia/cpu/compiler/compiler_passes.h"
|
||||
#include "xenia/cpu/cpu-private.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc/ppc_scanner.h"
|
||||
#include "xenia/cpu/frontend/ppc_disasm.h"
|
||||
#include "xenia/cpu/frontend/ppc_frontend.h"
|
||||
#include "xenia/cpu/frontend/ppc_hir_builder.h"
|
||||
#include "xenia/cpu/frontend/ppc_instr.h"
|
||||
#include "xenia/cpu/frontend/ppc_scanner.h"
|
||||
#include "xenia/cpu/runtime.h"
|
||||
#include "poly/reset_scope.h"
|
||||
#include "xenia/profiling.h"
|
||||
|
@ -23,7 +23,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
// TODO(benvanik): remove when enums redefined.
|
||||
using namespace xe::cpu;
|
||||
|
@ -124,7 +123,7 @@ int PPCTranslator::Translate(FunctionInfo* symbol_info,
|
|||
}
|
||||
|
||||
if (false) {
|
||||
xe::cpu::frontend::ppc::DumpAllInstrCounts();
|
||||
xe::cpu::frontend::DumpAllInstrCounts();
|
||||
}
|
||||
|
||||
// Emit function.
|
||||
|
@ -208,7 +207,6 @@ void PPCTranslator::DumpSource(FunctionInfo* symbol_info,
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_FRONTEND_PPC_PPC_TRANSLATOR_H_
|
||||
#define XENIA_FRONTEND_PPC_PPC_TRANSLATOR_H_
|
||||
#ifndef XENIA_FRONTEND_PPC_TRANSLATOR_H_
|
||||
#define XENIA_FRONTEND_PPC_TRANSLATOR_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
|||
namespace xe {
|
||||
namespace cpu {
|
||||
namespace frontend {
|
||||
namespace ppc {
|
||||
|
||||
class PPCFrontend;
|
||||
class PPCHIRBuilder;
|
||||
|
@ -47,9 +46,8 @@ class PPCTranslator {
|
|||
poly::StringBuffer string_buffer_;
|
||||
};
|
||||
|
||||
} // namespace ppc
|
||||
} // namespace frontend
|
||||
} // namespace cpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_FRONTEND_PPC_PPC_TRANSLATOR_H_
|
||||
#endif // XENIA_FRONTEND_PPC_TRANSLATOR_H_
|
|
@ -3,11 +3,30 @@
|
|||
'sources': [
|
||||
'context_info.cc',
|
||||
'context_info.h',
|
||||
'frontend.cc',
|
||||
'frontend.h',
|
||||
'ppc_context.cc',
|
||||
'ppc_context.h',
|
||||
'ppc_disasm.cc',
|
||||
'ppc_disasm.h',
|
||||
'ppc_emit-private.h',
|
||||
'ppc_emit.h',
|
||||
'ppc_emit_altivec.cc',
|
||||
'ppc_emit_alu.cc',
|
||||
'ppc_emit_control.cc',
|
||||
'ppc_emit_fpu.cc',
|
||||
'ppc_emit_memory.cc',
|
||||
'ppc_frontend.cc',
|
||||
'ppc_frontend.h',
|
||||
'ppc_hir_builder.cc',
|
||||
'ppc_hir_builder.h',
|
||||
'ppc_instr.cc',
|
||||
'ppc_instr.h',
|
||||
'ppc_instr_tables.h',
|
||||
'ppc_scanner.cc',
|
||||
'ppc_scanner.h',
|
||||
'ppc_translator.cc',
|
||||
'ppc_translator.h',
|
||||
],
|
||||
|
||||
'includes': [
|
||||
'ppc/sources.gypi',
|
||||
],
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_add.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_add.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_addc.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_addc.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_adde.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_adde.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_addic.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_addic.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_addme.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_addme.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_addze.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_addze.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_cntlzd.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_cntlzd.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_cntlzw.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_cntlzw.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_divd.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_divd.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_divdu.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_divdu.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_divw.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_divw.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_divwu.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_divwu.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_eqv.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_eqv.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_fabs.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_fabs.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_fsel.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_fsel.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_lvexx.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_lvexx.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_lvl.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_lvl.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_lvr.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_lvr.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_lvsl.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_lvsl.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_lvsr.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_lvsr.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_mulhd.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_mulhd.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_mulhdu.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_mulhdu.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_mulhw.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_mulhw.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/vagrant/src/xenia/cpu/frontend/ppc/test/bin//instr_mulhwu.o: file format elf64-powerpc
|
||||
/vagrant/src/xenia/cpu/frontend/test/bin//instr_mulhwu.o: file format elf64-powerpc
|
||||
|
||||
|
||||
Disassembly of section .text:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue