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 #72450

Closed
SJC0719 opened this issue May 8, 2024 · 1 comment
Closed

RISCV:fpu_sharing #72450

SJC0719 opened this issue May 8, 2024 · 1 comment
Assignees
Labels
area: RISCV RISCV Architecture (32-bit & 64-bit) bug The issue is a bug, or the PR is fixing a bug

Comments

@SJC0719
Copy link

SJC0719 commented May 8, 2024

Describe the bug
In the riscv/isr.S file, when the fpu_sharing mode is enabled, to determine whether the exception cause for entering isr_wrapper is triggered by fpu, compare the value of the entire mcause register with 0x2, resulting in failure to enter is_fpu。
The mcause register contains more than just the exception_code field.

To Reproduce

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

csrr t2, mcause

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

bne t1, t2, no_fp

Expected behavior
exception_code field in register mcause is compared with 0x2 instead of the entire mcause register

/* 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

Impact
ztest/fpu_sharing error.

@SJC0719 SJC0719 added the bug The issue is a bug, or the PR is fixing a bug label May 8, 2024
@henrikbrixandersen henrikbrixandersen added the area: RISCV RISCV Architecture (32-bit & 64-bit) label May 10, 2024
@aescolar
Copy link
Member

Duplicate of #72128

@aescolar aescolar marked this as a duplicate of #72128 May 14, 2024
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
Projects
None yet
Development

No branches or pull requests

7 participants