Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/dynarec/arm64/dynarec_arm64_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,12 +1573,17 @@ void addSSEPreload(dynarec_arm_t* dyn, int ninst, int i2, uint32_t preload)
if(i2 && !dyn->insts[i2-1].x64.has_next) // need a previous opcode to set the preload, unless it's the #0
return;
// check if there is jump out or outside this loop
int has_host_call = 0;
for(int i=i2; i<ninst; ++i) {
if(!dyn->insts[i].x64.has_next || (dyn->insts[i].x64.barrier&BARRIER_FLOAT))
return;
// for now, unneeded stop at first jump, so this should also stop there
if(dyn->insts[i].x64.jmp/* && ((dyn->insts[i].x64.jmp_insts>ninst) || (dyn->insts[i].x64.jmp_insts<i2))*/)
return;
if(dyn->insts[i].host_call_clobber)
return;
if(dyn->insts[i].host_call)
has_host_call = 1;
}
uint16_t ymm_mask = 0;
for(int i=0; i<16; ++i) {
Expand Down Expand Up @@ -1617,9 +1622,9 @@ void addSSEPreload(dynarec_arm_t* dyn, int ninst, int i2, uint32_t preload)
}
}
preload = (preload&0xffff) | (ymm_mask<<16); // update ymm_mask
//TODO: should check native calls too?
dyn->insts[i2].preload_xmmymm = preload;
dyn->insts[i2].preload_from = ninst;
dyn->insts[i2].preload_host_call = has_host_call;
dyn->insts[i2].n.xmm_unneeded |= preload&0xffff;
dyn->insts[i2].n.ymm_unneeded |= ymm_mask;
}
6 changes: 6 additions & 0 deletions src/dynarec/arm64/dynarec_arm64_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ void iret_to_next(dynarec_arm_t* dyn, uintptr_t ip, int ninst, int is32bits, int
void call_c(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int reg, int ret, int saveflags, int savereg)
{
MAYUSE(fnc);
dyn->insts[ninst].host_call = 1;
CHECK_DFNONE(1);
#if STEP == 0
dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE;
Expand Down Expand Up @@ -607,6 +608,7 @@ void call_c(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int reg, int ret,
void call_d(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int ret, int arg1, int arg2, int sav1, int sav2)
{
MAYUSE(fnc);
dyn->insts[ninst].host_call = 1;
CHECK_DFNONE(1);
#if STEP == 0
dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE;
Expand Down Expand Up @@ -653,6 +655,8 @@ void call_d(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int ret, int arg1
void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w)
{
MAYUSE(fnc);
dyn->insts[ninst].host_call = 1;
dyn->insts[ninst].host_call_clobber = 1;
CHECK_DFNONE(1);
#if STEP == 0
dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE;
Expand Down Expand Up @@ -2128,6 +2132,8 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int
MESSAGE(LOG_DUMP, "\tFPU Cache Transform ---- ninst=%d -> %d\n", ninst, i2);
uint32_t unneeded = dyn->insts[i2].n.xmm_unneeded | (dyn->insts[i2].n.ymm_unneeded<<16);
if((!i2) || (dyn->insts[i2].x64.barrier&BARRIER_FLOAT)) {
if(dyn->insts[i2].preload_host_call)
unneeded &= ~dyn->insts[i2].preload_xmmymm;
int need_purge = 0;
if(dyn->n.stack_next)
need_purge = 1;
Expand Down
2 changes: 2 additions & 0 deletions src/dynarec/arm64/dynarec_arm64_pass0.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
dyn->n.combined1 = dyn->n.combined2 = 0;\
dyn->n.swapped = 0; dyn->n.barrier = 0; \
dyn->insts[ninst].f_entry = dyn->f; \
dyn->insts[ninst].host_call = 0; \
dyn->insts[ninst].host_call_clobber = 0;\
dyn->insts[ninst].x64.strongmem = ((box64_wine && VolatileRangesContains(ip)) ? 0 : BOX64DRENV(dynarec_strongmem)); \
if(dyn->insts[ninst].x64.strongmem && cpuext.lrcpc && cpuext.lrcpc2 && cpuext.uscat) dyn->insts[ninst].use_lrcpc = 1; \
if(ninst) {dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr;} \
Expand Down
3 changes: 3 additions & 0 deletions src/dynarec/arm64/dynarec_arm64_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ typedef struct instruction_arm64_s {
unsigned x87_used:1; // no fine tracking, just a global "any reg used"
unsigned fpu_used:1; // any xmm/ymm/x87/mmx reg used
unsigned fpupurge:1; // this opcode will purge all fpu regs
unsigned host_call:1; // this opcode performs a native call
unsigned host_call_clobber:1; // native call does not preserve cached xmm0-7 (call_n)
unsigned preload_host_call:1; // preload range contains a host call, needs write-back at merge
unsigned use_lrcpc:1;// use the various lrcpc opcode here instead of regular LD/ST + memory barrier
unsigned has_lrcpc:1;// set if the opcode has some lrcpc opcode in it
flagcache_t f_exit; // flags status at end of instruction
Expand Down
Loading