Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zfhmin): support flh and fsh with mmu mode #704

Merged
merged 1 commit into from
Dec 4, 2024
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
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
Loading