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

RISCV: fpu_sharing mode #72128

Closed
SJC0719 opened this issue Apr 30, 2024 · 3 comments · Fixed by #72523
Closed

RISCV: fpu_sharing mode #72128

SJC0719 opened this issue Apr 30, 2024 · 3 comments · Fixed by #72523
Assignees
Labels
area: RISCV RISCV Architecture (32-bit & 64-bit) bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@SJC0719
Copy link

SJC0719 commented Apr 30, 2024

In the isr.S file in the riscv directory, after the fpu_sharling function is enabled, the system reads the value of the csr register mcause to determine whether the current exception belongs to the fpu operation. In this file, the system directly compares the value of mcause with that of 2 to determine whether to enter the jump. However, the actual mcause value is only used to determine the low 7bit, other bits may exist other values, resulting in the program can not jump normally

`

/* determine if FPU access was disabled */

li t1, MSTATUS_FS

and t1, t1, t2

bnez t1, no_fp

/* determine if this is an Illegal Instruction exception */

csrr t2, mcause

and t2,t2,SOC_MCAUSE_EXP_MASK      //The low exception number should be performed or operated on here

li t1, 2		/* 2 = illegal instruction */

bne t1, t2, no_fp

/* determine if we trapped on an FP instruction. */

csrr t2, mtval		/* get faulting instruction */

`

@SJC0719 SJC0719 added the bug The issue is a bug, or the PR is fixing a bug label Apr 30, 2024
Copy link

Hi @SJC0719! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@SJC0719 SJC0719 changed the title RISCV: fpu_sharling mode RISCV: fpu_sharing mode Apr 30, 2024
@aescolar aescolar added the area: RISCV RISCV Architecture (32-bit & 64-bit) label Apr 30, 2024
@aescolar aescolar added the priority: medium Medium impact/importance bug label Apr 30, 2024
@aescolar
Copy link
Member

@SJC0719 Please use the template when filling issues

@fkokosinski
Copy link
Member

Hey @npitre, could you perhaps take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: RISCV RISCV Architecture (32-bit & 64-bit) bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants