build: Refactor HOST_NO_REC everywhere

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2015-07-25 08:39:35 +02:00
parent a9c76351f6
commit 9cf9bacd13
19 changed files with 44 additions and 42 deletions

View File

@ -116,7 +116,6 @@
*/
#define NO_MMU
//#define HOST_NO_REC
#define DC_PLATFORM_MASK 7
#define DC_PLATFORM_NORMAL 0 /* Works, for the most part */
@ -146,7 +145,7 @@
#define COMPILER_VC 0x30000001
#define COMPILER_GCC 0x30000002
//FEAT_SHREC, FEAT_AREC
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
#define DYNAREC_NONE 0x40000001
#define DYNAREC_JIT 0x40000002
#define DYNAREC_CPP 0x40000003
@ -206,16 +205,18 @@
#if defined(TARGET_NO_REC)
#define FEAT_SHREC DYNAREC_NONE
#define FEAT_AREC DYNAREC_NONE
#define FEAT_DSPREC DYNAREC_NONE
#endif
#if defined(TARGET_NO_JIT)
#define FEAT_SHREC DYNAREC_CPP
#define FEAT_AREC DYNAREC_NONE
#define FEAT_DSPREC DYNAREC_NONE
#endif
//defaults
#ifndef FEAT_SHREC
#define FEAT_SHREC DYNAREC_JIT
#define FEAT_SHREC DYNAREC_JIT
#endif
#ifndef FEAT_AREC
@ -226,6 +227,14 @@
#endif
#endif
#ifndef FEAT_DSPREC
#if HOST_CPU == CPU_X86
#define FEAT_DSPREC DYNAREC_JIT
#else
#define FEAT_DSPREC DYNAREC_NONE
#endif
#endif
//Depricated build configs
#ifdef HOST_NO_REC
#error Outdated build config

View File

@ -88,7 +88,7 @@ RZDCY_CFLAGS := \
endif
ifdef NO_REC
RZDCY_CFLAGS += -DHOST_NO_REC
RZDCY_CFLAGS += -DTARGET_NO_REC
endif
ifndef DESKTOPGL

View File

@ -22,7 +22,7 @@
DECL_ALIGN(4096) dsp_t dsp;
#if HOST_OS==OS_WINDOWS && !defined(HOST_NO_REC)
#if HOST_CPU == CPU_X86 && FEAT_DSPREC == DYNAREC_JIT
#include "emitter/x86_emitter.h"
const bool SUPPORT_NOFL=false;

View File

@ -606,7 +606,7 @@ void _vmem_bm_reset()
bool BM_LockedWrite(u8* address)
{
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
u32 addr=address-(u8*)p_sh4rcb->fpcb;
address=(u8*)p_sh4rcb->fpcb+ (addr&~PAGE_MASK);

View File

@ -25,7 +25,7 @@
op_agent_t oprofHandle;
#endif
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
typedef vector<RuntimeBlockInfo*> bm_List;
@ -683,5 +683,5 @@ void print_blocks()
if (f) fclose(f);
}
#endif //#ifndef HOST_NO_REC
#endif

View File

@ -5,7 +5,7 @@
#include "types.h"
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
#include "decoder.h"
#include "shil.h"
@ -1040,9 +1040,7 @@ void dec_DecodeBlock(RuntimeBlockInfo* rbi,u32 max_cycles)
{
blk=rbi;
state.Setup(blk->addr,blk->fpu_cfg);
#ifndef HOST_NO_REC
ngen_GetFeatures(&state.ngen);
#endif
blk->guest_opcodes=0;

View File

@ -1,5 +1,5 @@
#pragma once
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
#define sh4dec(str) void dec_##str (u32 op)
#else
#define sh4dec(str) static void dec_##str (u32 op) { }

View File

@ -25,7 +25,7 @@
#include "ngen.h"
#include "decoder.h"
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
//uh uh
#if HOST_OS == OS_WINDOWS
@ -459,24 +459,19 @@ bool recSh4_IsCpuRunning()
{
return Sh4_int_IsCpuRunning();
}
#endif
void Get_Sh4Recompiler(sh4_if* rv)
{
#ifdef HOST_NO_REC
Get_Sh4Interpreter(rv);
#else
rv->Run=recSh4_Run;
rv->Stop=recSh4_Stop;
rv->Step=recSh4_Step;
rv->Skip=recSh4_Skip;
rv->Reset=recSh4_Reset;
rv->Init=recSh4_Init;
rv->Term=recSh4_Term;
rv->IsCpuRunning=recSh4_IsCpuRunning;
rv->Run = recSh4_Run;
rv->Stop = recSh4_Stop;
rv->Step = recSh4_Step;
rv->Skip = recSh4_Skip;
rv->Reset = recSh4_Reset;
rv->Init = recSh4_Init;
rv->Term = recSh4_Term;
rv->IsCpuRunning = recSh4_IsCpuRunning;
//rv->GetRegister=Sh4_int_GetRegister;
//rv->SetRegister=Sh4_int_SetRegister;
rv->ResetCache=recSh4_ClearCache;
#endif
rv->ResetCache = recSh4_ClearCache;
}
#endif

View File

@ -1017,7 +1017,7 @@ bool UpdateSR();
//#define SHIL_MODE 2
//#include "shil_canonical.h"
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
#define SHIL_MODE 3
#include "shil_canonical.h"
#endif

View File

@ -180,7 +180,7 @@ int DreamcastSecond(int tag, int c, int j)
prof_periodical();
#endif
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
bm_Periodical_1s();
#endif

View File

@ -460,7 +460,7 @@ return;
if ('a' == key) rt[port]=255;
if ('s' == key) lt[port]=255;
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
if ('b' == key) emit_WriteCodeCache();
if ('n' == key) bm_Reset();
if ('m' == key) bm_Sort();

View File

@ -65,7 +65,7 @@ void fault_handler (int sn, siginfo_t * si, void *segfault_ctx)
if (VramLockedWrite((u8*)si->si_addr) || BM_LockedWrite((u8*)si->si_addr))
return;
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
#if HOST_CPU==CPU_ARM
else if (dyna_cde)
{

View File

@ -249,7 +249,7 @@ void* prof(void *ptr)
//Write shrec syms file !
prof_head(prof_out, "jitsym", "SH4");
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
sh4_jitsym(prof_out);
#endif

View File

@ -183,7 +183,7 @@ int dc_init(int argc,wchar* argv[])
printf("Did not load bios, using reios\n");
}
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
if(settings.dynarec.Enable)
{
Get_Sh4Recompiler(&sh4_cpu);

View File

@ -67,7 +67,7 @@ extern u32 samples_gen;
void print_blocks();
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
//called every emulated second
void prof_periodical()
{
@ -77,7 +77,7 @@ void prof_periodical()
DMAW=SQW=0;
#endif
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
print_blocks();
#endif

View File

@ -66,7 +66,7 @@ vstm r3,{d0-d3}
bx lr
#ifndef HOST_NO_REC
#if FEAT_SHREC != DYNAREC_NONE
@@@@@@@@@@ ngen_LinkBlock_*****_stub @@@@@@@@@@

View File

@ -2,7 +2,7 @@
#include <sys/mman.h>
#include "types.h"
#ifndef HOST_NO_REC
#if FEAT_SHREC == DYNAREC_JIT
#include "hw/sh4/sh4_opcode_list.h"
#include "hw/sh4/sh4_mmr.h"

View File

@ -125,7 +125,7 @@ int ExeptionHandler(u32 dwCode, void* pExceptionPointers)
{
return EXCEPTION_CONTINUE_EXECUTION;
}
#if !defined(HOST_NO_REC) && HOST_CPU != CPU_X64
#if FEAT_SHREC == DYNAREC_JIT && HOST_CPU == CPU_X86
else if ( ngen_Rewrite((unat&)ep->ContextRecord->Eip,*(unat*)ep->ContextRecord->Esp,ep->ContextRecord->Eax) )
{
//remove the call from call stack

View File

@ -387,12 +387,12 @@ JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_send(JNIEnv *env,jobj
if (param==1)
{
settings.pvr.ta_skip^=1;
printf("settings.pvr.ta_skip: %d\n",settings.pvr.ta_skip);
settings.pvr.ta_skip^=1;
printf("settings.pvr.ta_skip: %d\n",settings.pvr.ta_skip);
}
if (param==2)
{
#if !defined(HOST_NO_REC)
#if FEAT_SHREC != DYNAREC_NONE
print_stats=true;
printf("Storing blocks ...\n");
#endif