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

✨ Add symmetric add operation for same source FP format add/sub #114

Merged

Conversation

michael-platzer
Copy link
Contributor

@michael-platzer michael-platzer commented May 7, 2024

This PR adds a new operation ADDS to the operation_e enum, which implements a symmetric addition/subtraction, i.e., with both addends having the same source format.

As discussed in #113, currently the addend (i.e., the third operand) of the multi-format FMA is given in destination FP format, rather than source FP format. While this makes sense for fused multiply-accumulate operations, which add the product of two multiplicands in one FP format to an accumulator value in destination FP format, it is beneficial to support symmetric addition and subtraction, for which both addends are in source FP format.

For backwards compatibility and to avoid adding new ports to the top module, this PR adds a dedicated new operation ADDS for this symmetric add, which has the effect of selecting the source FP format for the FMA's third operand, rather than the destination FP format. A new port add_fmt_i is added to the multi-format FMA for this purpose and assigned based on the selected operation.

Closes #113.

@michael-platzer
Copy link
Contributor Author

@lucabertaccini @pascalgouedo @stmach Any feedback on this? 🙃

@pascalgouedo
Copy link

pascalgouedo commented May 21, 2024

Hi @michael-platzer
I approved the proposal but I have no time to review the updates as I am in the last straight line for CV32E40Pv2.

src/fpnew_pkg.sv Outdated Show resolved Hide resolved
@lucabertaccini
Copy link
Collaborator

LGTM

@zarubaf zarubaf merged commit 3f83cc3 into openhwgroup:develop May 23, 2024
1 check passed
@michael-platzer michael-platzer deleted the feature/multi-fma-symmetric-add branch May 26, 2024 08:30
michael-platzer added a commit to michael-platzer/cvfpu that referenced this pull request Aug 22, 2024
…hwgroup#114)

* 🏷️ Add new operation for symmetric (same src fmt) add

* ✨ Select multi FMA addend fmt independently

* 💡 Add new operation to comment in multi FMA src

* 📝 Document new symmetric add operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: allow the FMA addend to be in either src_fmt_i or dst_fmt_i
5 participants