From b6a9dfe7e02208e04935c8be2d1338b0c0edd2d4 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Fri, 1 Feb 2013 00:21:59 -0800 Subject: [PATCH] Tweaking output. --- TODO.md | 86 +++++++++++++++++++ common.gypi | 2 +- include/xenia/config.h | 2 +- src/cpu/codegen/function_generator.cc | 28 ++++-- src/cpu/codegen/module_generator.cc | 2 - .../modules/xboxkrnl/objects/xmodule.cc | 3 + 6 files changed, 110 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index 9109c938d..9ac5a05d1 100644 --- a/TODO.md +++ b/TODO.md @@ -44,6 +44,92 @@ KeBugCheck: ``` rlwimix rldiclx +addcx +addex +addicx +andisx +cntlzdx +dcbf +dcbz +divdux +divdx +divwx +eieio +eqvx +extshx +extswx +fabsx +faddsx +faddx +fcfidx +fcmpu +fctidzx +fctiwzx +fdivsx +fdivx +fmaddsx +fmaddx +fmrx +fmsubsx +fmsubx +fmulsx +fmulx +fnegx +fnmsubsx +fnmsubx +frspx +fselx +fsqrtx +fsubsx +fsubx +ldarx +ldx +lfd +lfdx +lfs +lfsu +lfsux +lfsx +lha +lhax +lhzu +lhzx +lwa +lwarx +lwax +lwbrx +lwzux +mftb +mulldx +nandx +negx +orcx +rldiclx +rldicrx +rldimix +rlwnmx +sldx +sradix +sradx +srawx +srdx +srwx +stbx +stdcx +stdx +stfd +stfdu +stfdx +stfiwx +stfs +stfsu +stfsx +stwbrx +stwcx +stwux +subfcx +subfzex +sync ``` ### XER CA bit (carry) diff --git a/common.gypi b/common.gypi index cebf7569d..3bec009e0 100644 --- a/common.gypi +++ b/common.gypi @@ -12,7 +12,7 @@ # LLVM paths. # TODO(benvanik): switch based on configuration. - 'llvm_path': 'build/llvm/debug/', + 'llvm_path': 'build/llvm/release/', 'llvm_config': '<(llvm_path)bin/llvm-config', 'llvm_includedir': '<(llvm_path)/include', 'llvm_cxxflags': [ diff --git a/include/xenia/config.h b/include/xenia/config.h index aaa05aca8..413275232 100644 --- a/include/xenia/config.h +++ b/include/xenia/config.h @@ -23,7 +23,7 @@ #define XE_OPTION_LOG_INFO 1 #define XE_OPTION_LOG_DEBUG 1 #define XE_OPTION_LOG_CPU 1 -#define XE_OPTION_LOG_SDB 1 +#define XE_OPTION_LOG_SDB 0 #define XE_OPTION_LOG_GPU 1 #define XE_OPTION_LOG_KERNEL 1 #define XE_OPTION_LOG_FS 1 diff --git a/src/cpu/codegen/function_generator.cc b/src/cpu/codegen/function_generator.cc index 7b2385c02..d4fb1f528 100644 --- a/src/cpu/codegen/function_generator.cc +++ b/src/cpu/codegen/function_generator.cc @@ -24,6 +24,8 @@ using namespace xe::cpu::sdb; DEFINE_bool(memory_address_verification, false, "Whether to add additional checks to generated memory load/stores."); +DEFINE_bool(log_codegen, false, + "Log codegen to stdout."); /** @@ -75,6 +77,10 @@ FunctionGenerator::FunctionGenerator( for (size_t n = 0; n < XECOUNT(locals_.gpr); n++) { locals_.gpr[n] = NULL; } + + if (FLAGS_log_codegen) { + printf("%s:\n", fn->name); + } } FunctionGenerator::~FunctionGenerator() { @@ -269,7 +275,9 @@ void FunctionGenerator::GenerateBasicBlock(FunctionBlock* block) { BasicBlock* bb = GetBasicBlock(block->start_address); XEASSERTNOTNULL(bb); - printf(" bb %.8X-%.8X:\n", block->start_address, block->end_address); + if (FLAGS_log_codegen) { + printf(" bb %.8X-%.8X:\n", block->start_address, block->end_address); + } fn_block_ = block; bb_ = bb; @@ -311,14 +319,16 @@ void FunctionGenerator::GenerateBasicBlock(FunctionBlock* block) { continue; } - if (i.type->disassemble) { - ppc::InstrDisasm d; - i.type->disassemble(i, d); - std::string disasm; - d.Dump(disasm); - printf(" %.8X: %.8X %s\n", ia, i.code, disasm.c_str()); - } else { - printf(" %.8X: %.8X %s ???\n", ia, i.code, i.type->name); + if (FLAGS_log_codegen) { + if (i.type->disassemble) { + ppc::InstrDisasm d; + i.type->disassemble(i, d); + std::string disasm; + d.Dump(disasm); + printf(" %.8X: %.8X %s\n", ia, i.code, disasm.c_str()); + } else { + printf(" %.8X: %.8X %s ???\n", ia, i.code, i.type->name); + } } // TODO(benvanik): debugging information? source/etc? diff --git a/src/cpu/codegen/module_generator.cc b/src/cpu/codegen/module_generator.cc index 07bf03ecd..77f11ed64 100644 --- a/src/cpu/codegen/module_generator.cc +++ b/src/cpu/codegen/module_generator.cc @@ -301,8 +301,6 @@ void ModuleGenerator::PrepareFunction(FunctionSymbol* fn) { void ModuleGenerator::BuildFunction(CodegenFunction* cgf) { FunctionSymbol* fn = cgf->symbol; - printf("%s:\n", fn->name); - // Setup the generation context. FunctionGenerator fgen( memory_, sdb_, fn, context_, gen_module_, cgf->function); diff --git a/src/kernel/modules/xboxkrnl/objects/xmodule.cc b/src/kernel/modules/xboxkrnl/objects/xmodule.cc index 7246ba813..0277f284f 100644 --- a/src/kernel/modules/xboxkrnl/objects/xmodule.cc +++ b/src/kernel/modules/xboxkrnl/objects/xmodule.cc @@ -120,8 +120,11 @@ void* XModule::GetProcAddressByOrdinal(uint16_t ordinal) { X_STATUS XModule::Launch(uint32_t flags) { const xe_xex2_header_t* header = xex_header(); + XELOGI(XT("Launching module...")); + // Set as the main module, while running. kernel_state()->SetExecutableModule(this); + fflush(stdout); // Create a thread to run in. XThread* thread = new XThread(