Screw convention; moving include files alongside source files.

They now will show up in xcode/etc.
This commit is contained in:
Ben Vanik 2013-02-06 02:19:50 -08:00
parent 3dfd9c4b00
commit 88431eadce
151 changed files with 290 additions and 200 deletions

View File

@ -2,9 +2,15 @@
{
'sources': [
'file.cc',
'file.h',
'memory.cc',
'memory.h',
'mmap.h',
'mutex.h',
'pal.cc',
'pal.h',
'ref.cc',
'ref.h',
],
'conditions': [

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/codegen/emit.h"
#include <xenia/cpu/codegen/emit.h>
#include <llvm/IR/Intrinsics.h>
@ -263,8 +263,56 @@ XEDISASMR(divwx, 0x7C0003D6, XO )(InstrData& i, InstrDisasm& d) {
return d.Finish();
}
XEEMITTER(divwx, 0x7C0003D6, XO )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) {
XEINSTRNOTIMPLEMENTED();
return 1;
// dividend[0:31] <- (RA)[32:63]
// divisor[0:31] <- (RB)[32:63]
// if divisor = 0 then
// if OE = 1 then
// XER[OV] <- 1
// return
// RT[32:63] <- dividend ÷ divisor
// RT[0:31] <- undefined
Value* dividend = b.CreateTrunc(g.gpr_value(i.XO.RA), b.getInt32Ty());
Value* divisor = b.CreateTrunc(g.gpr_value(i.XO.RB), b.getInt32Ty());
// Note that we skip the zero handling block and just avoid the divide if
// we are OE=0.
BasicBlock* zero_bb = i.XO.OE ?
BasicBlock::Create(*g.context(), "", g.gen_fn()) : NULL;
BasicBlock* nonzero_bb = BasicBlock::Create(*g.context(), "", g.gen_fn());
BasicBlock* after_bb = BasicBlock::Create(*g.context(), "", g.gen_fn());
b.CreateCondBr(b.CreateICmpEQ(divisor, b.getInt32(0)),
i.XO.OE ? zero_bb : after_bb, nonzero_bb);
if (zero_bb) {
// Divisor was zero - do XER update.
b.SetInsertPoint(zero_bb);
g.update_xer_with_overflow(b.getInt1(1));
b.CreateBr(after_bb);
}
// Divide.
b.SetInsertPoint(nonzero_bb);
Value* v = b.CreateSDiv(dividend, divisor);
v = b.CreateSExt(v, b.getInt64Ty());
g.update_gpr_value(i.XO.RT, v);
// If we are OE=1 we need to clear the overflow bit.
if (i.XO.OE) {
g.update_xer_with_overflow(b.getInt1(0));
}
if (i.XO.Rc) {
// With cr0 update.
g.update_cr_with_cond(0, v, b.getInt64(0), true);
}
b.CreateBr(after_bb);
// Resume.
b.SetInsertPoint(after_bb);
return 0;
}
XEDISASMR(divwux, 0x7C000396, XO )(InstrData& i, InstrDisasm& d) {
@ -449,8 +497,41 @@ XEDISASMR(negx, 0x7C0000D0, XO )(InstrData& i, InstrDisasm& d) {
return d.Finish();
}
XEEMITTER(negx, 0x7C0000D0, XO )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) {
XEINSTRNOTIMPLEMENTED();
return 1;
// RT <- ¬(RA) + 1
if (i.XO.OE) {
// With XER update.
// This is a different codepath as we need to use llvm.ssub.with.overflow.
// if RA == 0x8000000000000000 then no-op and set OV=1
// This may just magically do that...
Function* ssub_with_overflow = Intrinsic::getDeclaration(
g.gen_module(), Intrinsic::ssub_with_overflow, b.getInt64Ty());
Value* v = b.CreateCall2(ssub_with_overflow,
b.getInt64(0), g.gpr_value(i.XO.RA));
Value* v0 = b.CreateExtractValue(v, 0);
g.update_gpr_value(i.XO.RT, v0);
g.update_xer_with_overflow(b.CreateExtractValue(v, 1));
if (i.XO.Rc) {
// With cr0 update.
g.update_cr_with_cond(0, v0, b.getInt64(0), true);
}
return 0;
} else {
// No OE bit setting.
Value* v = b.CreateSub(b.getInt64(0), g.gpr_value(i.XO.RA));
g.update_gpr_value(i.XO.RT, v);
if (i.XO.Rc) {
// With cr0 update.
g.update_cr_with_cond(0, v, b.getInt64(0), true);
}
return 0;
}
}
XEDISASMR(subfx, 0x7C000050, XO )(InstrData& i, InstrDisasm& d) {

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/codegen/emit.h"
#include <xenia/cpu/codegen/emit.h>
#include <xenia/cpu/codegen/function_generator.h>
#include <xenia/cpu/ppc/state.h>

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/codegen/emit.h"
#include <xenia/cpu/codegen/emit.h>
#include <xenia/cpu/codegen/function_generator.h>
@ -173,7 +173,28 @@ XEEMITTER(fcmpo, 0xFC000040, X )(FunctionGenerator& g, IRBuilder<>& b, I
return 1;
}
XEDISASMR(fcmpu, 0xFC000000, X )(InstrData& i, InstrDisasm& d) {
d.Init("fcmpu", "Floating Compare Unordered",
(i.XO.OE ? InstrDisasm::kOE : 0) | (i.XO.Rc ? InstrDisasm::kRc : 0));
d.AddRegOperand(InstrRegister::kGPR, i.XO.RT, InstrRegister::kWrite);
d.AddRegOperand(InstrRegister::kGPR, i.XO.RA, InstrRegister::kRead);
d.AddRegOperand(InstrRegister::kGPR, i.XO.RB, InstrRegister::kRead);
return d.Finish();
}
XEEMITTER(fcmpu, 0xFC000000, X )(FunctionGenerator& g, IRBuilder<>& b, InstrData& i) {
// if (FRA) is a NaN or (FRB) is a NaN then
// c <- 0b0001
// else if (FRA) < (FRB) then
// c <- 0b1000
// else if (FRA) > (FRB) then
// c <- 0b0100
// else {
// c <- 0b0010
// }
// FPCC <- c
// CR[4*BF:4*BF+3] <- c
// if (FRA) is an SNaN or (FRB) is an SNaN then
// VXSNAN <- 1
XEINSTRNOTIMPLEMENTED();
return 1;
}

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/codegen/emit.h"
#include <xenia/cpu/codegen/emit.h>
#include <xenia/cpu/codegen/function_generator.h>

View File

@ -11,10 +11,9 @@
#include <llvm/IR/Intrinsics.h>
#include <xenia/cpu/cpu-private.h>
#include <xenia/cpu/ppc/state.h>
#include "cpu/cpu-private.h"
using namespace llvm;
using namespace xe::cpu::codegen;

View File

@ -24,11 +24,10 @@
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <xenia/cpu/cpu-private.h>
#include <xenia/cpu/ppc.h>
#include <xenia/cpu/codegen/function_generator.h>
#include "cpu/cpu-private.h"
using namespace llvm;
using namespace xe;

View File

@ -1,11 +1,14 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'emit.h',
'emit_alu.cc',
'emit_control.cc',
'emit_fpu.cc',
'emit_memory.cc',
'function_generator.cc',
'function_generator.h',
'module_generator.cc',
'module_generator.h',
],
}

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/cpu-private.h"
#include <xenia/cpu/cpu-private.h>
// Tracing:

View File

@ -7,9 +7,9 @@
******************************************************************************
*/
#ifndef XENIA_CPU_H_
#define XENIA_CPU_H_
#ifndef XENIA_CPU_CPU_H_
#define XENIA_CPU_CPU_H_
#include <xenia/cpu/processor.h>
#endif // XENIA_CPU_H_
#endif // XENIA_CPU_CPU_H_

View File

@ -28,14 +28,13 @@
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <xenia/cpu/codegen/module_generator.h>
#include <xenia/cpu/cpu-private.h>
#include <xenia/cpu/llvm_exports.h>
#include <xenia/cpu/sdb.h>
#include <xenia/cpu/codegen/module_generator.h>
#include <xenia/cpu/ppc/instr.h>
#include <xenia/cpu/ppc/state.h>
#include "cpu/cpu-private.h"
#include "cpu/llvm_exports.h"
#include "cpu/xethunk/xethunk.h"
#include <xenia/cpu/xethunk/xethunk.h>
using namespace llvm;
@ -107,7 +106,7 @@ int ExecModule::Prepare() {
PassManagerBuilder pmb;
// TODO(benvanik): embed the bc file into the emulator.
const char *thunk_path = "src/cpu/xethunk/xethunk.bc";
const char *thunk_path = "src/xenia/cpu/xethunk/xethunk.bc";
// Calculate a cache path based on the module, the CPU version, and other
// bits.

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "cpu/llvm_exports.h"
#include <xenia/cpu/llvm_exports.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/IR/Constants.h>

View File

@ -11,7 +11,7 @@
#include <sstream>
#include "cpu/ppc/instr_tables.h"
#include <xenia/cpu/ppc/instr_tables.h>
using namespace xe::cpu::ppc;

View File

@ -2,6 +2,9 @@
{
'sources': [
'instr.cc',
'instr.h',
'instr_tables.h',
'state.cc',
'state.h',
],
}

View File

@ -18,7 +18,7 @@
#include <llvm/Support/ManagedStatic.h>
#include <llvm/Support/TargetSelect.h>
#include "cpu/codegen/emit.h"
#include <xenia/cpu/codegen/emit.h>
using namespace llvm;

View File

@ -2,8 +2,12 @@
{
'sources': [
'raw_symbol_database.cc',
'raw_symbol_database.h',
'symbol.cc',
'symbol.h',
'symbol_database.cc',
'symbol_database.h',
'xex_symbol_database.cc',
'xex_symbol_database.h',
]
}

View File

@ -1,11 +1,18 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'cpu-private.h',
'cpu.cc',
'cpu.h',
'exec_module.cc',
'exec_module.h',
'llvm_exports.cc',
'llvm_exports.h',
'ppc.h',
'processor.cc',
'processor.h',
'thread_state.cc',
'thread_state.h',
],
'includes': [

View File

@ -12,8 +12,7 @@
#include <gflags/gflags.h>
#include <xenia/dbg/content_source.h>
#include "dbg/ws_listener.h"
#include <xenia/dbg/ws_listener.h>
using namespace xe;

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "dbg/listener.h"
#include <xenia/dbg/listener.h>
using namespace xe;

View File

@ -2,10 +2,16 @@
{
'sources': [
'client.cc',
'client.h',
'content_source.cc',
'content_source.h',
'debugger.cc',
'debugger.h',
'listener.cc',
'listener.h',
'ws_client.cc',
'ws_client.h',
'ws_listener.cc',
'ws_listener.h',
],
}

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "dbg/ws_client.h"
#include <xenia/dbg/ws_client.h>
#include <xenia/dbg/debugger.h>

View File

@ -7,13 +7,13 @@
******************************************************************************
*/
#include "dbg/ws_listener.h"
#include <xenia/dbg/ws_listener.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include "dbg/ws_client.h"
#include <xenia/dbg/ws_client.h>
using namespace xe;

View File

@ -13,7 +13,7 @@
#include <xenia/common.h>
#include <xenia/core.h>
#include "dbg/listener.h"
#include <xenia/dbg/listener.h>
namespace xe {

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include <xenia/gpu.h>
#include <xenia/gpu/gpu.h>
void do_gpu_stuff() {

View File

@ -7,12 +7,12 @@
******************************************************************************
*/
#ifndef XENIA_GPU_H_
#define XENIA_GPU_H_
#ifndef XENIA_GPU_GPU_H_
#define XENIA_GPU_GPU_H_
#include <xenia/common.h>
#include <xenia/core.h>
void do_gpu_stuff();
#endif // XENIA_GPU_H_
#endif // XENIA_GPU_GPU_H_

View File

@ -2,5 +2,6 @@
{
'sources': [
'gpu.cc',
'gpu.h',
],
}

View File

@ -7,9 +7,9 @@
******************************************************************************
*/
#include "kernel/fs/devices/disc_image_device.h"
#include <xenia/kernel/fs/devices/disc_image_device.h>
#include "kernel/fs/gdfx.h"
#include <xenia/kernel/fs/gdfx.h>
using namespace xe;
@ -46,7 +46,6 @@ public:
}
virtual ~DiscImageFileEntry() {
delete gdfx_entry_;
xe_mmap_release(mmap_);
}

View File

@ -7,7 +7,7 @@
******************************************************************************
*/
#include "kernel/fs/devices/local_directory_device.h"
#include <xenia/kernel/fs/devices/local_directory_device.h>
using namespace xe;

View File

@ -2,6 +2,8 @@
{
'sources': [
'disc_image_device.cc',
'disc_image_device.h',
'local_directory_device.cc',
'local_directory_device.h',
],
}

View File

@ -9,8 +9,8 @@
#include <xenia/kernel/fs/filesystem.h>
#include "kernel/fs/devices/disc_image_device.h"
#include "kernel/fs/devices/local_directory_device.h"
#include <xenia/kernel/fs/devices/disc_image_device.h>
#include <xenia/kernel/fs/devices/local_directory_device.h>
using namespace xe;

View File

@ -9,7 +9,7 @@
* - abgx360
*/
#include "kernel/fs/gdfx.h"
#include <xenia/kernel/fs/gdfx.h>
using namespace xe;
@ -24,6 +24,10 @@ namespace {
}
GDFXEntry::GDFXEntry() :
attributes(0), offset(0), size(0) {
}
GDFXEntry::~GDFXEntry() {
for (std::vector<GDFXEntry*>::iterator it = children.begin();
it != children.end(); ++it) {
@ -170,10 +174,8 @@ bool GDFX::ReadEntry(ParseState& state, const uint8_t* buffer,
entry->name.append(1, '\0');
entry->attributes = attributes;
// Add to parent (if we have one).
if (parent) {
parent->children.push_back(entry);
}
// Add to parent.
parent->children.push_back(entry);
if (attributes & GDFXEntry::kAttrFolder) {
// Folder.

View File

@ -38,7 +38,7 @@ public:
kAttrNormal = 0x00000080,
};
GDFXEntry() {}
GDFXEntry();
~GDFXEntry();
GDFXEntry* GetChild(const char* name);

View File

@ -2,9 +2,13 @@
{
'sources': [
'device.cc',
'device.h',
'entry.cc',
'entry.h',
'filesystem.cc',
'filesystem.h',
'gdfx.cc',
'gdfx.h',
],
'includes': [

View File

@ -7,9 +7,9 @@
******************************************************************************
*/
#ifndef XENIA_KERNEL_H_
#define XENIA_KERNEL_H_
#ifndef XENIA_KERNEL_KERNEL_H_
#define XENIA_KERNEL_KERNEL_H_
#include <xenia/kernel/runtime.h>
#endif // XENIA_KERNEL_H_
#endif // XENIA_KERNEL_KERNEL_H_

View File

@ -10,7 +10,7 @@
#ifndef XENIA_KERNEL_MODULES_H_
#define XENIA_KERNEL_MODULES_H_
#include "kernel/modules/xam/xam_module.h"
#include "kernel/modules/xboxkrnl/module.h"
#include <xenia/kernel/modules/xam/xam_module.h>
#include <xenia/kernel/modules/xboxkrnl/module.h>
#endif // XENIA_KERNEL_MODULES_H_

View File

@ -1,5 +1,9 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'modules.h',
],
'includes': [
'xam/sources.gypi',
'xboxkrnl/sources.gypi',

Some files were not shown because too many files have changed in this diff Show More