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

[BUG] Improper setting of fcsr flag after executing feq.s on an invalid NaN-boxed value #2504

Open
1 task done
riscv914 opened this issue Sep 20, 2024 · 2 comments
Open
1 task done
Labels
notCV32A65X It is not an CV32A65X issue PARAM:FPU Issue depends on the FPU parameter Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@riscv914
Copy link

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Based on the RISC-V ISA specification, Executing Single-Precision Floating-Point FEQ by invalid NaN-boxed inputs (a value that most significant 32 bits are not set to 1) performs a quiet comparison: it only sets the invalid operation exception flag (NV flag on fcsr) if either input is a signaling NaN. However, on CVA6, the flag is not set.

Execute the following instruction:

int main(void){
    asm volatile ("lui  t0, 0x8a1ec");
    asm volatile ("fcvt.d.w ft5, t0"); 
    asm volatile ("feq.s  t0, ft5, ft5");
    asm volatile ("csrr     t1, fcsr"); // t1=0x0000000000000000
}
- Spike version: `1.1.1-dev`
- version: `CVA6 commit: f974e105bf88cf81c32f55789b0baab4fe4d16c9`
- OS: `CentOS Linux release 7.9.2009 kernel: 5.15.0-78-generic`
- Simulator: `VCS_2023`
@riscv914 riscv914 added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Sep 20, 2024
@JeanRochCoulon
Copy link
Contributor

JeanRochCoulon commented Sep 22, 2024

CVA6 uses FPU coming from CVFPU repository. To maximise the support, I advise you to post this github issue in CVFPU repository and close this current issue.
Same comment for your others git issues related to FPU.

@JeanRochCoulon JeanRochCoulon added PARAM:FPU Issue depends on the FPU parameter notCV32A65X It is not an CV32A65X issue labels Sep 22, 2024
@riscv914
Copy link
Author

@JeanRochCoulon Thank you for clarification, I will submit the issues there also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notCV32A65X It is not an CV32A65X issue PARAM:FPU Issue depends on the FPU parameter Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

2 participants