Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
flycast
Commits
352536f9
Commit
352536f9
authored
Mar 01, 2021
by
Libretro-Admin
Browse files
Get rid of core/rec.cpp to make it more in line with upstream
parent
3b40fa8f
Pipeline
#15814
passed with stages
in 3 minutes and 50 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Makefile.common
View file @
352536f9
...
...
@@ -432,12 +432,11 @@ endif
# Dynarec
ifeq
($(DYNAREC_USED), 1)
SOURCES_CXX
+=
$(CORE_DIR)
/core/rec.cpp
SOURCES_CXX
+=
$(CORE_DIR)
/core/hw/sh4/dyna/decoder.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/driver.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/blockmanager.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/shil.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/ssa.cpp
SOURCES_CXX
+=
$(CORE_DIR)
/core/hw/sh4/dyna/decoder.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/driver.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/blockmanager.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/shil.cpp
\
$(CORE_DIR)
/core/hw/sh4/dyna/ssa.cpp
endif
SOURCES_CXX
+=
$(CORE_DIR)
/core/libretro/libretro.cpp
\
...
...
core/rec-ARM/rec_arm.cpp
View file @
352536f9
...
...
@@ -2476,9 +2476,14 @@ void ngen_init(void)
}
void
ngen_GetFeatures
(
ngen_features
*
dst
)
{
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
RuntimeBlockInfo
*
ngen_AllocateBlock
()
{
return
new
DynaRBI
();
};
#endif
core/rec-ARM64/rec_arm64.cpp
View file @
352536f9
...
...
@@ -104,6 +104,12 @@ void ngen_ResetBlocks()
}
}
void
ngen_GetFeatures
(
ngen_features
*
dst
)
{
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
template
<
typename
T
>
static
T
ReadMemNoEx
(
u32
addr
,
u32
,
u32
pc
)
{
...
...
core/rec-cpp/rec_cpp.cpp
View file @
352536f9
#include "types.h"
#include <map>
#include <algorithm>
#include "hw/sh4/sh4_opcode_list.h"
#include "hw/sh4/modules/ccn.h"
...
...
@@ -16,21 +14,44 @@
#define SHIL_MODE 2
#include "hw/sh4/dyna/shil_canonical.h"
#include <algorithm>
#include <map>
#define MIPS_COUNTER 0
struct
DynaRBI
:
RuntimeBlockInfo
{
virtual
u32
Relink
()
{
//verify(false);
return
0
;
}
virtual
void
Relocate
(
void
*
dst
)
{
verify
(
false
);
}
};
extern
int
mips_counter
;
extern
int
cycle_counter
;
int
cycle_counter
;
void
ngen_blockcheckfail_CC
(
u32
pc
)
{
INFO_LOG
(
DYNAREC
,
"REC CPP: SMC invalidation at %08X"
,
pc
);
rdv_BlockCheckFail
(
pc
);
void
ngen_init
()
{
}
int
idxnxx
=
0
;
void
ngen_
ResetBlocks
(
void
)
void
ngen_
GetFeatures
(
ngen_features
*
dst
)
{
idxnxx
=
0
;
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
RuntimeBlockInfo
*
ngen_AllocateBlock
()
{
return
new
DynaRBI
();
}
void
ngen_blockcheckfail
(
u32
pc
)
{
INFO_LOG
(
DYNAREC
,
"REC CPP: SMC invalidation at %08X"
,
pc
);
rdv_BlockCheckFail
(
pc
);
}
class
opcodeExec
{
...
...
@@ -1070,19 +1091,19 @@ struct opcode_check_block : public opcodeExec {
{
case
4
:
if
(
*
(
u32
*
)
ptr
!=
*
(
u32
*
)
&
code
[
0
])
ngen_blockcheckfail
_CC
(
block
->
addr
);
ngen_blockcheckfail
(
block
->
addr
);
break
;
case
6
:
if
(
*
(
u32
*
)
ptr
!=
*
(
u32
*
)
&
code
[
0
]
||
*
((
u16
*
)
ptr
+
2
)
!=
*
((
u16
*
)
&
code
[
0
]
+
2
))
ngen_blockcheckfail
_CC
(
block
->
addr
);
ngen_blockcheckfail
(
block
->
addr
);
break
;
case
8
:
if
(
*
(
u32
*
)
ptr
!=
*
(
u32
*
)
&
code
[
0
]
||
*
((
u32
*
)
ptr
+
1
)
!=
*
((
u32
*
)
&
code
[
0
]
+
1
))
ngen_blockcheckfail
_CC
(
block
->
addr
);
ngen_blockcheckfail
(
block
->
addr
);
break
;
default:
if
(
memcmp
(
ptr
,
&
code
[
0
],
block
->
sh4_code_size
)
!=
0
)
ngen_blockcheckfail
_CC
(
block
->
addr
);
ngen_blockcheckfail
(
block
->
addr
);
break
;
}
}
...
...
@@ -1460,7 +1481,7 @@ void disaptchn() {
dispatchb
[
n
].
runner
(
dispatchb
[
n
].
fnb
);
}
extern
int
idxnxx
;
int
idxnxx
=
0
;
//&disaptchn
#define REP_1(x, phrase) phrase < x >
#define REP_2(x, phrase) REP_1(x, phrase), REP_1(x+1, phrase)
...
...
@@ -1888,26 +1909,38 @@ void ngen_Compile(RuntimeBlockInfo* block, bool force_checks, bool reset, bool s
delete
compiler
;
}
void
ngen_CC_
Call
(
shil_opcode
*
op
,
void
*
function
)
void
ngen_CC_
Start
(
shil_opcode
*
op
)
{
BlockCompilercpp
*
compiler
=
compilercpp_data
;
compiler
->
ngen_CC_
Call
(
op
,
function
);
compiler
->
ngen_CC_
Start
(
op
);
}
void
ngen_CC_
Finish
(
shil_opcode
*
op
)
void
ngen_CC_
Param
(
shil_opcode
*
op
,
shil_param
*
par
,
CanonicalParamType
tp
)
{
BlockCompilercpp
*
compiler
=
compilercpp_data
;
compiler
->
ngen_CC_
Finish
(
o
p
);
compiler
->
ngen_CC_
param
(
*
op
,
*
par
,
t
p
);
}
void
ngen_CC_
Start
(
shil_opcode
*
op
)
void
ngen_CC_
Call
(
shil_opcode
*
op
,
void
*
function
)
{
BlockCompilercpp
*
compiler
=
compilercpp_data
;
compiler
->
ngen_CC_
Start
(
op
);
compiler
->
ngen_CC_
Call
(
op
,
function
);
}
void
ngen_CC_
Param
(
shil_opcode
*
op
,
shil_param
*
par
,
CanonicalParamType
tp
)
void
ngen_CC_
Finish
(
shil_opcode
*
op
)
{
BlockCompilercpp
*
compiler
=
compilercpp_data
;
compiler
->
ngen_CC_param
(
*
op
,
*
par
,
tp
);
compiler
->
ngen_CC_Finish
(
op
);
}
void
ngen_ResetBlocks
(
void
)
{
idxnxx
=
0
;
/* FIXME issues when block check fails -> delete current block/op
for (int i = 0; i < CODE_ENTRY_COUNT && dispatchb[i].fnb != nullptr; i++)
{
delete dispatchb[i].fnb;
dispatchb[i].fnb = nullptr;
}
*/
}
core/rec-x64/rec_x64.cpp
View file @
352536f9
...
...
@@ -31,7 +31,9 @@ struct DynaRBI : RuntimeBlockInfo
}
};
extern
int
cycle_counter
;
extern
"C"
{
int
cycle_counter
;
}
extern
"C"
{
...
...
@@ -177,6 +179,12 @@ void ngen_ResetBlocks()
{
}
void
ngen_GetFeatures
(
ngen_features
*
dst
)
{
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
RuntimeBlockInfo
*
ngen_AllocateBlock
(
void
)
{
return
new
DynaRBI
();
...
...
core/rec-x86/rec_x86_driver.cpp
View file @
352536f9
...
...
@@ -18,6 +18,12 @@ struct DynaRBI: RuntimeBlockInfo
}
};
void
ngen_GetFeatures
(
ngen_features
*
dst
)
{
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
RuntimeBlockInfo
*
ngen_AllocateBlock
(
void
)
{
return
new
DynaRBI
();
...
...
@@ -25,7 +31,7 @@ RuntimeBlockInfo* ngen_AllocateBlock(void)
x86_block
*
x86e
;
extern
int
cycle_counter
;
static
int
cycle_counter
;
void
*
loop_no_update
;
void
*
intc_sched
;
...
...
core/rec.cpp
deleted
100644 → 0
View file @
3b40fa8f
#include "hw/sh4/sh4_core.h"
#include "hw/sh4/dyna/ngen.h"
int
cycle_counter
;
void
ngen_GetFeatures
(
ngen_features
*
dst
)
{
dst
->
InterpreterFallback
=
false
;
dst
->
OnlyDynamicEnds
=
false
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment