build: Refactor HOST_NO_REC everywhere
This commit is contained in:
parent
a9c76351f6
commit
9cf9bacd13
13
core/build.h
13
core/build.h
|
@ -116,7 +116,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NO_MMU
|
#define NO_MMU
|
||||||
//#define HOST_NO_REC
|
|
||||||
|
|
||||||
#define DC_PLATFORM_MASK 7
|
#define DC_PLATFORM_MASK 7
|
||||||
#define DC_PLATFORM_NORMAL 0 /* Works, for the most part */
|
#define DC_PLATFORM_NORMAL 0 /* Works, for the most part */
|
||||||
|
@ -146,7 +145,7 @@
|
||||||
#define COMPILER_VC 0x30000001
|
#define COMPILER_VC 0x30000001
|
||||||
#define COMPILER_GCC 0x30000002
|
#define COMPILER_GCC 0x30000002
|
||||||
|
|
||||||
//FEAT_SHREC, FEAT_AREC
|
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
|
||||||
#define DYNAREC_NONE 0x40000001
|
#define DYNAREC_NONE 0x40000001
|
||||||
#define DYNAREC_JIT 0x40000002
|
#define DYNAREC_JIT 0x40000002
|
||||||
#define DYNAREC_CPP 0x40000003
|
#define DYNAREC_CPP 0x40000003
|
||||||
|
@ -206,11 +205,13 @@
|
||||||
#if defined(TARGET_NO_REC)
|
#if defined(TARGET_NO_REC)
|
||||||
#define FEAT_SHREC DYNAREC_NONE
|
#define FEAT_SHREC DYNAREC_NONE
|
||||||
#define FEAT_AREC DYNAREC_NONE
|
#define FEAT_AREC DYNAREC_NONE
|
||||||
|
#define FEAT_DSPREC DYNAREC_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_NO_JIT)
|
#if defined(TARGET_NO_JIT)
|
||||||
#define FEAT_SHREC DYNAREC_CPP
|
#define FEAT_SHREC DYNAREC_CPP
|
||||||
#define FEAT_AREC DYNAREC_NONE
|
#define FEAT_AREC DYNAREC_NONE
|
||||||
|
#define FEAT_DSPREC DYNAREC_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//defaults
|
//defaults
|
||||||
|
@ -226,6 +227,14 @@
|
||||||
#endif
|
#endif
|
||||||
#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
|
//Depricated build configs
|
||||||
#ifdef HOST_NO_REC
|
#ifdef HOST_NO_REC
|
||||||
#error Outdated build config
|
#error Outdated build config
|
||||||
|
|
|
@ -88,7 +88,7 @@ RZDCY_CFLAGS := \
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef NO_REC
|
ifdef NO_REC
|
||||||
RZDCY_CFLAGS += -DHOST_NO_REC
|
RZDCY_CFLAGS += -DTARGET_NO_REC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef DESKTOPGL
|
ifndef DESKTOPGL
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
DECL_ALIGN(4096) dsp_t dsp;
|
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"
|
#include "emitter/x86_emitter.h"
|
||||||
|
|
||||||
const bool SUPPORT_NOFL=false;
|
const bool SUPPORT_NOFL=false;
|
||||||
|
|
|
@ -606,7 +606,7 @@ void _vmem_bm_reset()
|
||||||
|
|
||||||
bool BM_LockedWrite(u8* address)
|
bool BM_LockedWrite(u8* address)
|
||||||
{
|
{
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
u32 addr=address-(u8*)p_sh4rcb->fpcb;
|
u32 addr=address-(u8*)p_sh4rcb->fpcb;
|
||||||
|
|
||||||
address=(u8*)p_sh4rcb->fpcb+ (addr&~PAGE_MASK);
|
address=(u8*)p_sh4rcb->fpcb+ (addr&~PAGE_MASK);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
op_agent_t oprofHandle;
|
op_agent_t oprofHandle;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
|
|
||||||
|
|
||||||
typedef vector<RuntimeBlockInfo*> bm_List;
|
typedef vector<RuntimeBlockInfo*> bm_List;
|
||||||
|
@ -683,5 +683,5 @@ void print_blocks()
|
||||||
|
|
||||||
if (f) fclose(f);
|
if (f) fclose(f);
|
||||||
}
|
}
|
||||||
#endif //#ifndef HOST_NO_REC
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
|
|
||||||
#include "decoder.h"
|
#include "decoder.h"
|
||||||
#include "shil.h"
|
#include "shil.h"
|
||||||
|
@ -1040,9 +1040,7 @@ void dec_DecodeBlock(RuntimeBlockInfo* rbi,u32 max_cycles)
|
||||||
{
|
{
|
||||||
blk=rbi;
|
blk=rbi;
|
||||||
state.Setup(blk->addr,blk->fpu_cfg);
|
state.Setup(blk->addr,blk->fpu_cfg);
|
||||||
#ifndef HOST_NO_REC
|
|
||||||
ngen_GetFeatures(&state.ngen);
|
ngen_GetFeatures(&state.ngen);
|
||||||
#endif
|
|
||||||
|
|
||||||
blk->guest_opcodes=0;
|
blk->guest_opcodes=0;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
#define sh4dec(str) void dec_##str (u32 op)
|
#define sh4dec(str) void dec_##str (u32 op)
|
||||||
#else
|
#else
|
||||||
#define sh4dec(str) static void dec_##str (u32 op) { }
|
#define sh4dec(str) static void dec_##str (u32 op) { }
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "ngen.h"
|
#include "ngen.h"
|
||||||
#include "decoder.h"
|
#include "decoder.h"
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
//uh uh
|
//uh uh
|
||||||
|
|
||||||
#if HOST_OS == OS_WINDOWS
|
#if HOST_OS == OS_WINDOWS
|
||||||
|
@ -459,13 +459,9 @@ bool recSh4_IsCpuRunning()
|
||||||
{
|
{
|
||||||
return Sh4_int_IsCpuRunning();
|
return Sh4_int_IsCpuRunning();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void Get_Sh4Recompiler(sh4_if* rv)
|
void Get_Sh4Recompiler(sh4_if* rv)
|
||||||
{
|
{
|
||||||
#ifdef HOST_NO_REC
|
|
||||||
Get_Sh4Interpreter(rv);
|
|
||||||
#else
|
|
||||||
rv->Run = recSh4_Run;
|
rv->Run = recSh4_Run;
|
||||||
rv->Stop = recSh4_Stop;
|
rv->Stop = recSh4_Stop;
|
||||||
rv->Step = recSh4_Step;
|
rv->Step = recSh4_Step;
|
||||||
|
@ -477,6 +473,5 @@ void Get_Sh4Recompiler(sh4_if* rv)
|
||||||
//rv->GetRegister=Sh4_int_GetRegister;
|
//rv->GetRegister=Sh4_int_GetRegister;
|
||||||
//rv->SetRegister=Sh4_int_SetRegister;
|
//rv->SetRegister=Sh4_int_SetRegister;
|
||||||
rv->ResetCache = recSh4_ClearCache;
|
rv->ResetCache = recSh4_ClearCache;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ bool UpdateSR();
|
||||||
//#define SHIL_MODE 2
|
//#define SHIL_MODE 2
|
||||||
//#include "shil_canonical.h"
|
//#include "shil_canonical.h"
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
#define SHIL_MODE 3
|
#define SHIL_MODE 3
|
||||||
#include "shil_canonical.h"
|
#include "shil_canonical.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -180,7 +180,7 @@ int DreamcastSecond(int tag, int c, int j)
|
||||||
prof_periodical();
|
prof_periodical();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
bm_Periodical_1s();
|
bm_Periodical_1s();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,7 @@ return;
|
||||||
|
|
||||||
if ('a' == key) rt[port]=255;
|
if ('a' == key) rt[port]=255;
|
||||||
if ('s' == key) lt[port]=255;
|
if ('s' == key) lt[port]=255;
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
if ('b' == key) emit_WriteCodeCache();
|
if ('b' == key) emit_WriteCodeCache();
|
||||||
if ('n' == key) bm_Reset();
|
if ('n' == key) bm_Reset();
|
||||||
if ('m' == key) bm_Sort();
|
if ('m' == key) bm_Sort();
|
||||||
|
|
|
@ -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))
|
if (VramLockedWrite((u8*)si->si_addr) || BM_LockedWrite((u8*)si->si_addr))
|
||||||
return;
|
return;
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
#if HOST_CPU==CPU_ARM
|
#if HOST_CPU==CPU_ARM
|
||||||
else if (dyna_cde)
|
else if (dyna_cde)
|
||||||
{
|
{
|
||||||
|
|
|
@ -249,7 +249,7 @@ void* prof(void *ptr)
|
||||||
//Write shrec syms file !
|
//Write shrec syms file !
|
||||||
prof_head(prof_out, "jitsym", "SH4");
|
prof_head(prof_out, "jitsym", "SH4");
|
||||||
|
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
sh4_jitsym(prof_out);
|
sh4_jitsym(prof_out);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ int dc_init(int argc,wchar* argv[])
|
||||||
printf("Did not load bios, using reios\n");
|
printf("Did not load bios, using reios\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
if(settings.dynarec.Enable)
|
if(settings.dynarec.Enable)
|
||||||
{
|
{
|
||||||
Get_Sh4Recompiler(&sh4_cpu);
|
Get_Sh4Recompiler(&sh4_cpu);
|
||||||
|
|
|
@ -67,7 +67,7 @@ extern u32 samples_gen;
|
||||||
|
|
||||||
void print_blocks();
|
void print_blocks();
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
//called every emulated second
|
//called every emulated second
|
||||||
void prof_periodical()
|
void prof_periodical()
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ void prof_periodical()
|
||||||
DMAW=SQW=0;
|
DMAW=SQW=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
print_blocks();
|
print_blocks();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ vstm r3,{d0-d3}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
|
|
||||||
@@@@@@@@@@ ngen_LinkBlock_*****_stub @@@@@@@@@@
|
@@@@@@@@@@ ngen_LinkBlock_*****_stub @@@@@@@@@@
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#ifndef HOST_NO_REC
|
#if FEAT_SHREC == DYNAREC_JIT
|
||||||
#include "hw/sh4/sh4_opcode_list.h"
|
#include "hw/sh4/sh4_opcode_list.h"
|
||||||
|
|
||||||
#include "hw/sh4/sh4_mmr.h"
|
#include "hw/sh4/sh4_mmr.h"
|
||||||
|
|
|
@ -125,7 +125,7 @@ int ExeptionHandler(u32 dwCode, void* pExceptionPointers)
|
||||||
{
|
{
|
||||||
return EXCEPTION_CONTINUE_EXECUTION;
|
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) )
|
else if ( ngen_Rewrite((unat&)ep->ContextRecord->Eip,*(unat*)ep->ContextRecord->Esp,ep->ContextRecord->Eax) )
|
||||||
{
|
{
|
||||||
//remove the call from call stack
|
//remove the call from call stack
|
||||||
|
|
|
@ -392,7 +392,7 @@ JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_send(JNIEnv *env,jobj
|
||||||
}
|
}
|
||||||
if (param==2)
|
if (param==2)
|
||||||
{
|
{
|
||||||
#if !defined(HOST_NO_REC)
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
print_stats=true;
|
print_stats=true;
|
||||||
printf("Storing blocks ...\n");
|
printf("Storing blocks ...\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue