-
Notifications
You must be signed in to change notification settings - Fork 204
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
Add support for the Zfa ISA extension #330
Conversation
Link for test results using RISCOF can be found here. |
This PR also lacks the coverage reports and the CGF files. Please include them in the drive folder. |
The CGF files are in the linked riscv-ctg PR. The coverage report is blocked by #331. |
Updated the PR: fixed the rounding modes for |
Updated PR:
|
Now that Zfa is ratified (https://wiki.riscv.org/display/HOME/Specification+Status#SpecificationStatus-Zfa_Row) what is next? |
The fcvtmod tests need to replace dynamic with rtz. See the riscv-zfa spec at Section 264: "The assembly syntax requires the RTZ rounding mode to be explicitly specified, i.e., fcvtmod.w.d rd, rs1, rtz" Looks like this is mentioned above, but I don't see the rtz in the file. |
Also, note that one of the tests (in both rv32i_m and rv64i_m) produces a discrepancy between Sail and Spike. ERROR | /home/harris/cvw/addins/riscv-arch-test/riscv-test-suite/rv32i_m/D_Zfa/src/fcvtmod.w.d_b22-01.S : - : Failed I believe Sail is setting the wrong flag. I have submitted the issue to |
I don't see froundnx tests in the repository even though they are in the ctg. |
Why are there more fleq.s tests in D_Zfa/src/fleq_b1-01.S than in F_Zfa/src/fleq_b1-01.S? Why doesn't D_Zfa just add double-precision tests that aren't in F_Zfa? |
The patch documentation above says that fcvtmod.w.d is for FLEN=32 only. I think that is a typo and should say for FLEN=64 only. |
When attempting to regenerate the tests, I found riscv-ctg broken (triggering a code-path that always fires an exception). I've addressed this in riscv-software-src/riscv-ctg#102.
fter looking into riscv-ctg, it becomes obvious why the 'dyn' rounding mode is still in this PR:
However, the field So, this feature was dropped, and I can't see a replacement in CTG atm.
Thanks for reporting!
Thanks! This was caused by a typo in the CTG PR, which has been addressed.
I don't see anything odd in the CTG PR so that it might be the intended behavior of CTG.
Thanks! I've updated the description accordingly. Thanks for reviewing the PR! |
Thanks for looking into all of these. I'm trying to test CORE-V Wally Zfa and discovering things as I go. The regular D tests are exclusive of the cases already covered by F tests. For example, rv32i_m/D contains fadd.d but not fadd.s. By the same reasoning, it would seem that rv32i_m/D_Zfa should contain fltq.d but not fltq. Similarly, I don't think it needs to have fleq, fmaxm, fminm, or fround. |
The CORE-V Wally team would love to try the remaining tests when possible. We're happy to help if there's something we can do. |
Is it easy to add the missing fmvp.d.x tests? rv32i_m/D_Zfa/fmvp.d.x |
I just checked and there are two issues why this test does not exist:
I have not analyzed this further so far. |
Something happened to fcvtmod.w.d when the tests were regenerated. The rounding modes were changed from rz to dyn. This is incorrect - the instruction should always use rz per the spec: "It is encoded like FCVT.W.D, but with the rs2 field set to 8 and the rm field set to 1 (RTZ). Other rm values are reserved." Here is the May 22, 2023 version of fcvtmod.w.d_b22 using rz. inst_0:// rs1==f31, rd==x31,fs1 == 0 and fe1 == 0x3fc and fm1 == 0x08577924770d3 and fcsr == 0x0 and rm_val == 7 The version currently in the PR has dyn instead of rz. Could you regenerate the fcvtmod.w.d tests with rz? |
This is a bit weird. Presumably the test on this latest was run and passed, yet the instructions as defined should not have even assembled without errors; I didn't think the toolchain would allow it if the spec required rtz |
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i}, $FLEN={32,64}), and CFG=$INSN: riscv_ctg.py \ --cgf sample_cgfs/dataset.cgf \ --cgf sample_cgfs/zfa/$CGF \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is ratified and can be found here: https://github.com/riscv/riscv-isa-manual/blob/main/src/zfa.adoc Signed-off-by: Christoph Müllner <[email protected]>
Thanks for spotting the reintroduction of the I've updated this PR with regenerated tests. |
It's failing the C/I because of changelog issues.
I don't know if that's because the version number wasn't updated,
or because it was updated, but shouldn't have been though.
…On Tue, Apr 2, 2024 at 1:21 AM Christoph Müllner ***@***.***> wrote:
Thanks for spotting the reintroduction of the rtz issue.
I've updated riscv-software-src/riscv-ctg#60
<riscv-software-src/riscv-ctg#60> so that this
won't happen again.
I've updated this PR with regenerated tests.
—
Reply to this email directly, view it on GitHub
<#330 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJWVFJBL2LROTOYISBTY3JS75AVCNFSM6AAAAAAWVK6RN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRGM3DSOJZGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Signed-off-by: Allen Baum <[email protected]>
This PR shows: "Review required", "All checks have passed", "Merging is blocked". |
Ah, good, I was wondering about that. I won't pull any triggers until that is done. |
|
I have reviewed and merged riscv-software-src/riscv-ctg#60, so there are no dependecies left for this one. We can merge this one as well, since it has already been reviewed by many people. |
Signed-off-by: Umer Shahid <[email protected]>
Added new entry in Changelog and resolved conflicts Signed-off-by: Umer Shahid <[email protected]>
I have resolved the conflicts by a forced commit. |
As its parallel riscv-ctg PR has been merged, so I am merging this one too. |
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions:
Zfa defines its instructions in combination with the following extensions:
Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions.
Given missing infrastructure support, the fli.* instruction tests are hand written and not generated.
All other test files are generated using riscv-ctg.
The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i}, $FLEN={32,64}), and CFG=$INSN:
riscv_ctg.py
--cgf sample_cgfs/dataset.cgf
--cgf sample_cgfs/zfa/$INSN.cfg
--base-isa $BASEISA
--flen $FLEN
-d tests_$BASEISA_$FLEN/
Exceptions are:
The resulting tests have been copied to the target directory.
The generation of the Zfa test cases depends on a PR in the riscv-ctg repository:
riscv-software-src/riscv-ctg#60
The Zfa specification is ratified and can be found here:
https://github.com/riscv/riscv-isa-manual/blob/main/src/zfa.adoc
Description
Related Issues
Ratified/Unratified Extensions
List Extensions
Reference Model Used
Mandatory Checklist:
Optional Checklist: