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

FP Denorm ACT #36

Open
13 tasks
jjscheel opened this issue Sep 27, 2023 · 21 comments
Open
13 tasks

FP Denorm ACT #36

jjscheel opened this issue Sep 27, 2023 · 21 comments
Assignees

Comments

@jjscheel
Copy link
Contributor

jjscheel commented Sep 27, 2023

Technical Group

Architecture Test SIG

ratification-pkg

all FP extensions

Technical Liaison

Allen Baum

Task Category

Arch Tests

Task Sub Category

  • gcc
  • binutils
  • gdb
  • intrinsics
  • Java
  • KVM
  • ld
  • llvm
  • Linux kernel
  • QEMU
  • Spike

Ratification Target

Legacy

Statement of Work (SOW)

Component names:
D,F,Q, Zfh, Zfinx, Zdinx, Zhinx

Requirements:
Add directed test cases for FP ops that generate a normalized result, but also set the underflow flag

Origin
For an obscure IEEE FP reason, it is possible to generate a normalized FP result while still setting the underflow
flag. This is because the underflow is set after rounding – but for some corner cases, two roundings can occur.
This happens when a denormalized number , after rounding, becomes the largest denorm.
When converted to a denorm format, a second rounding (if the result is odd) occurs, which can round up and
overflow for some rounding modes, and it becomes normalized.

Test Details of Required Tests

For each FP op (FADD, FSUB, FMUL, FDIV, FSQRT, FMUL[N][ADD/SUB},
                             FCVT.S.D, FCVT.D.Q, FCVT.H.x
                             (any FPCVT from a longer FP format to a shorter FP format)

Choose operands that result in raw values for each FP format (before any rounding) of
   EXP = -bias, (is 127 for single, 2047 for double, etc)
   SGN= 0 and1
   MANT = all 1s & all1-1 (including hidden bit) for each FP format
   All 4 combinations of guard and sticky bits

Deliverables:
Since the real requirement is generation of an internal rounded result of all 1s, which is not architecturally visible, we can’t write the coverage except to verify the output is either the smallest normalized number or the largest denorm.

  • Assembly language tests that meet the TestFormatSpec,
  • Coverage models using riscv-ctg YAML formatted schema Acceptance criteria

Acceptance Criteria:

  • Tests pass using the riscof framework

Projected timeframe: 3 months

SOW Signoffs: (delete those not needed)

  • Task group liaison sign-off
  • Development partner sign-off
  • ACT SIG sign-off (if ACT work)

Waiver

  • Freeze
  • Ratification

Pull Request Details

TBD

@jjscheel
Copy link
Contributor Author

@ptprasanna, please review this SOW and ask any questions here. The text came from @allenjbaum. He will be your primary resource on this item.

We should discuss more in our next meeting.

@jjscheel
Copy link
Contributor Author

Updated typos in the description section.

@jjscheel
Copy link
Contributor Author

Comments from @allenjbaum via email:

I'm wondering if we should include a requirement to show that the intermediate result is in the required range (e.g. with a manual calculation). That's pretty easy for most of these on RV32 (with a hex calculator) except divide and sqrt perhaps,
but more difficult with longer word lengths than hex calculators normally support.

Actually, the tricky bit (sic) is to see that guard/round bits have all 4 combinations

@jjscheel jjscheel changed the title FP denorm SOW FP Denorm Oct 10, 2023
@jjscheel jjscheel changed the title FP Denorm FP Denorm ACT Oct 10, 2023
@ptprasanna
Copy link

@jjscheel and @allenjbaum, Had a detailed discussion with @anuani21 on this, looks like we do have the tests available and running on the given combination. It's just that the underflow flag which we failed to set on fcsr to acknowledge the result is a denorm, is bit of a gap in the development, which is been caught now. @anuani21 is working on it to fix this up.

@jjscheel
Copy link
Contributor Author

jjscheel commented Nov 3, 2023

Thanks, @ptprasanna! Please keep working with @allenjbaum and the sig-arch-test group.

@allenjbaum
Copy link

allenjbaum commented Nov 6, 2023 via email

@jjscheel
Copy link
Contributor Author

@ptprasanna, any chance on an update here?

@anuani21
Copy link

@jjscheel Test generated for F,Zfh,Zfinx and Zhinx extensions and the execution is successful.Generated test case will produce a normalized result and also set an underflow flag.

Tests and coverage reports for F,Zfh,Zfinx and Zhinx are placed in the below link
https://gitlab.com/ptprasanna/actreports/-/tree/main/FP_denorm?ref_type=heads

@allenjbaum
Copy link

allenjbaum commented Nov 29, 2023 via email

@anuani21
Copy link

@allenjbaum, I am generating test case for D, Zdinx and Q extension for the given combination. Along with the coverage report for these extensions, I will raise a PR in appropriate riscv github.

@allenjbaum
Copy link

allenjbaum commented Dec 11, 2023 via email

@anuani21
Copy link

@jjscheel, Test generated for D extensions and the execution is successful.Generated test case will produce a normalized result and also set an underflow flag.

I am generating test case for Zdinx and Q extension for the given combination.Along with coverage report for these extensions, I will a raise a PR in appropriate riscv github.

@allenjbaum
Copy link

allenjbaum commented Jan 23, 2024 via email

@anuani21
Copy link

anuani21 commented Jan 23, 2024 via email

@allenjbaum
Copy link

allenjbaum commented Jan 23, 2024 via email

@anuani21
Copy link

@jjscheel, Here are the updates from IITM,

Zdinx- Three operand instructions like (fmadd,fmsub,fnmadd,fnmsub) test generated but few coverpoints are not met up.I am fixing this issue.
Q extension- yet to start the test.

@jjscheel
Copy link
Contributor Author

@anuani21, I have set the state of the project to "Planning". I'd appreciate some outlook as to when the work will be done and confirmation that this is a "Medium" sized project (3-6 months of work).

@anuani21
Copy link

No progress made since last Call. Was busy on Debug ACT for Native Triggers.

@anuani21
Copy link

No progress made since last Call. Was busy on Debug ACT for Native Triggers.

@anuani21
Copy link

anuani21 commented Sep 3, 2024

No progress made since last Call. Was busy on Debug ACT for Native Triggers.

@jjscheel
Copy link
Contributor Author

jjscheel commented Sep 3, 2024

Thanks. Understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

No branches or pull requests

4 participants