Skip to content

Commit

Permalink
fix(zfhmin): support flh and fsh with mmu mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziyue-Zhang authored and huxuan0307 committed Dec 4, 2024
1 parent e7be8a6 commit ca3baa0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/isa/riscv64/include/isa-all-instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
#ifdef CONFIG_RV_ZFH_MIN
#define ZFH_MIN_INSTR_BINARY(f) \
f(flh) f(fsh) \
f(flh_mmu) f(fsh_mmu) \
f(fmv_x_h) f(fmv_h_x) \
f(fcvt_s_h) f(fcvt_h_s) f(fcvt_d_h) f(fcvt_h_d)
#else //CONFIG_RV_ZFH_MIN
Expand Down
10 changes: 8 additions & 2 deletions src/isa/riscv64/instr/rvf/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def_THelper(fload) {
#ifndef CONFIG_FPU_NONE
def_INSTR_TAB("??????? ????? ????? 010 ????? ????? ??", flw_mmu);
def_INSTR_TAB("??????? ????? ????? 011 ????? ????? ??", fld_mmu);
#ifdef CONFIG_RV_ZFH_MIN
def_INSTR_TAB("??????? ????? ????? 001 ????? ????? ??", flh_mmu);
#endif
#endif // CONFIG_FPU_NONE
}

Expand All @@ -193,8 +196,8 @@ def_THelper(fstore) {
def_INSTR_TAB("??????? ????? ????? 010 ????? ????? ??", fsw);
def_INSTR_TAB("??????? ????? ????? 011 ????? ????? ??", fsd);
#ifdef CONFIG_RV_ZFH_MIN
def_INSTR_TAB("??????? ????? ????? 001 ????? ????? ??", fsh);
#endif//CONFIG_RV_ZFH
def_INSTR_TAB("??????? ????? ????? 001 ????? ????? ??", fsh);
#endif
}
#endif // CONFIG_FPU_NONE

Expand All @@ -211,6 +214,9 @@ def_THelper(fstore) {
if (fp_enable()) {
def_INSTR_TAB("??????? ????? ????? 010 ????? ????? ??", fsw_mmu);
def_INSTR_TAB("??????? ????? ????? 011 ????? ????? ??", fsd_mmu);
#ifdef CONFIG_RV_ZFH_MIN
def_INSTR_TAB("??????? ????? ????? 001 ????? ????? ??", fsh_mmu);
#endif
}
#endif // CONFIG_FPU_NONE

Expand Down
9 changes: 9 additions & 0 deletions src/isa/riscv64/instr/rvzfh/exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ def_EHelper(fsh) {
rtl_sm(s, ddest, dsrc1, id_src2->imm, 2, MMU_DIRECT);
}

def_EHelper(flh_mmu) {
rtl_lm(s, ddest, dsrc1, id_src2->imm, 2, MMU_TRANSLATE);
rtl_fsr(s, ddest, ddest, FPCALL_W16);
}

def_EHelper(fsh_mmu) {
rtl_sm(s, ddest, dsrc1, id_src2->imm, 2, MMU_TRANSLATE);
}

def_EHelper(fmv_x_h) {
rtl_sext(s, ddest, dsrc1, 2);
}
Expand Down

0 comments on commit ca3baa0

Please sign in to comment.