Skip to content

Commit

Permalink
[LA64_DYNAREC] Added nativeflags support (#2202)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco authored Dec 24, 2024
1 parent 3b15ef1 commit 1b262da
Show file tree
Hide file tree
Showing 26 changed files with 1,178 additions and 742 deletions.
2 changes: 1 addition & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Generated code for aligned atomics only
#### BOX64_DYNAREC_NATIVEFLAGS *
Generate code will use native flags if possible
* 0 : The code generated whill not use native flags even when possible
* 1 : Generated code will use native flags when possible (Arm64 only for now) (Default)
* 1 : Generated code will use native flags when possible (Default)

#### BOX64_DYNAREC_BLEEDING_EDGE *
Detect MonoBleedingEdge and apply conservative settings
Expand Down
4 changes: 2 additions & 2 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ HWCAP2_AFP
return;
}

if (la64_lbt = (((cpucfg2 >> 18) & 0b1) && box64_dynarec_nativeflags))
if (la64_lbt = ((cpucfg2 >> 18) & 0b1))
printf_log(LOG_INFO, " LBT_X86");
if ((la64_lam_bh = (cpucfg2 >> 27) & 0b1))
printf_log(LOG_INFO, " LAM_BH");
Expand Down Expand Up @@ -987,7 +987,7 @@ void LoadLogEnv()
box64_dynarec_x87double = 1;
box64_dynarec_div0 = 1;
box64_dynarec_callret = 0;
#ifdef RV64
#if defined( RV64) || defined(LA64)
box64_dynarec_nativeflags = 0;
#endif
printf_log(LOG_INFO, "Dynarec will compare it's execution with the interpreter (super slow, only for testing)\n");
Expand Down
2 changes: 1 addition & 1 deletion src/dynarec/dynarec_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#define RAZ_SPECIFIC(A, N)
#define UPDATE_SPECIFICS(A)
#define PREUPDATE_SPECIFICS(A)
#define PREUPDATE_SPECIFICS(A) updateNativeFlags(A)
#elif defined(RV64)

#define instruction_native_t instruction_rv64_t
Expand Down
2 changes: 1 addition & 1 deletion src/dynarec/dynarec_native_pass.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int
#if STEP > 0
if(dyn->insts[ninst].x64.has_next && dyn->insts[next].x64.barrier) {
if(dyn->insts[next].x64.barrier&BARRIER_FLOAT) {
#ifdef RV64
#if defined (RV64) || defined(LA64)
uint8_t tmp1, tmp2, tmp3;
if(dyn->insts[next].nat_flags_fusion) get_free_scratch(dyn, next, &tmp1, &tmp2, &tmp3, x1, x2, x3, x4, x5);
else { tmp1=x1; tmp2=x2; tmp3=x3; }
Expand Down
Loading

0 comments on commit 1b262da

Please sign in to comment.