Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco committed Sep 20, 2024
1 parent 8582913 commit 86226af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/dynarec/rv64/dynarec_rv64_660f_vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,22 +1012,22 @@ uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t i
nextop = F8;
SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1);
GETGX_vector(q0, 1, VECTOR_SEW64);
VMV_V_I(VMASK, 0b01);
if (MODREG) {
q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64);
} else {
VMV_V_I(VMASK, 0b01);
SMREAD();
addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0);
q1 = fpu_get_scratch(dyn);
VLE_V(q1, ed, VECTOR_SEW64, VECTOR_MASKED, VECTOR_NFIELD1);
}
VMV_X_S(x4, q1);
ADDI(x5, xZR, i32);
SET_ELEMENT_WIDTH(x1, u8, 1);
BLTU_MARK(x4, x5);
VXOR_VV(q0, q0, q0, VECTOR_UNMASKED);
B_NEXT_nocond;
MARK;
SET_ELEMENT_WIDTH(x1, u8, 1);
VSRL_VX(q0, x4, q0, VECTOR_UNMASKED);
break;
case 0xD4:
Expand Down
9 changes: 4 additions & 5 deletions src/dynarec/rv64/dynarec_rv64_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,18 @@ int fpu_get_reg_xmm(dynarec_rv64_t* dyn, int t, int xmm)
return EXTREG(i);
}
// Reset fpu regs counter
void fpu_reset_reg_extcache(extcache_t* e)
void fpu_reset_reg_extcache(dynarec_rv64_t* dyn, extcache_t* e)
{
e->fpu_reg = 0;
for (int i=0; i<24; ++i) {
e->fpuused[i]=0;
e->extcache[i].v = 0;
}
dyn->vector_sew = VECTOR_SEWNA;
}
void fpu_reset_reg(dynarec_rv64_t* dyn)
{
fpu_reset_reg_extcache(&dyn->e);
fpu_reset_reg_extcache(dyn, &dyn->e);
}

int extcache_no_i64(dynarec_rv64_t* dyn, int ninst, int st, int a)
Expand Down Expand Up @@ -732,16 +733,14 @@ void fpu_reset(dynarec_rv64_t* dyn)
mmx_reset(&dyn->e);
sse_reset(&dyn->e);
fpu_reset_reg(dyn);
dyn->vector_sew = VECTOR_SEWNA;
}

void fpu_reset_ninst(dynarec_rv64_t* dyn, int ninst)
{
x87_reset(&dyn->insts[ninst].e);
mmx_reset(&dyn->insts[ninst].e);
sse_reset(&dyn->insts[ninst].e);
fpu_reset_reg_extcache(&dyn->insts[ninst].e);
dyn->vector_sew = VECTOR_SEWNA;
fpu_reset_reg_extcache(dyn, &dyn->insts[ninst].e);
}

int fpu_is_st_freed(dynarec_rv64_t* dyn, int ninst, int st)
Expand Down

0 comments on commit 86226af

Please sign in to comment.