✨ Add symmetric add operation for same source FP format add/sub
Created by: michael-platzer
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 (closed), 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 (closed).