Comments (5)
I prefer solution 2 as it doesn't change top level as well as T-Head FDIV/FSQRT interfaces.
Regards,
Pascal.
from cvfpu.
Hi,
as you say, nothing fundamentally prevents using a separate format for each of the operands, and you nicely point out why we didn't need to do it so far when designing the unit.
While less general, I also like option 2 as it keeps the changes internal to the FMA module (which itself becomes more general) and doesn't introduce [even more] configurability to the whole unit where it's not needed in most cases. Specialized architectures can still use direct instances of the FMA block if they require a more specific configuration.
Cheers,
Steve
from cvfpu.
Thanks for the feedback @pascalgouedo and @stmach! In that case I will move forward with option 2 and add a new operation for the add with operands of the same FP type.
Specialized architectures can still use direct instances of the FMA block if they require a more specific configuration.
Should I then add a new port add_fmt_i
for the addend format to the FMA block, and assign as follows in all instantiations of the FMA?
.add_fmt_i ( op_i == fpnew_pkg::ADDW ? src_fmt_i : dst_fmt_i )
That would allow specialized architectures to have even more freedom when directly instantiating the FMA block. Or should the format of the addend rather be decided within the FMA block?
from cvfpu.
I think an extra port on the multiformat FMA and the necessary changes for assigning it in the instantiating block is worth the effort to keep some generality on one hand, and conceptually not mingle formats and operations too much in the execution unit (basically the format used in the execution unit itself should just be decided by the format port itself).
Secondly, just a personal nit on naming: I would probably name the new port src2_fmt
or similar (since it's just the format of the second source operand port), as with src_fmt
and add_fmt
there are kind of two separate nomenclatures (the addend is also a source after all) - I see that it was not very clean to begin with, as one of the source operands used the destination format in the past.
Consider renaming the format ports either
src01_fmt
&src2_fmt
(or justsrc
andsrc2
without the 01); ormul_fmt
&add_fmt
, but that clashes with the use ofsrc
anddst
in the rest of the project.
(in case you want to go fully generic crazy, you could make each operand format independent and have src_fmt
be an array of length 3 with one format for each operand - but that's not really something that's necessary at this point)
from cvfpu.
I think an extra port on the multiformat FMA and the necessary changes for assigning it in the instantiating block is worth the effort to keep some generality on one hand, and conceptually not mingle formats and operations too much in the execution unit (basically the format used in the execution unit itself should just be decided by the format port itself).
Alright, I agree that this sounds like a reasonable tradeoff.
Secondly, just a personal nit on naming: I would probably name the new port
src2_fmt
or similar (since it's just the format of the second source operand port), as withsrc_fmt
andadd_fmt
there are kind of two separate nomenclatures
Good point!
src01_fmt
&src2_fmt
(or justsrc
andsrc2
without the 01);
I went with this approach and renamed the new port to src2_fmt_i
. Updated my PR (#114) accordingly.
from cvfpu.
Related Issues (20)
- C/C++ example for float16alt
- Is it possible to do BF16*int8 + int8 using this IP ?
- Is it possible to do BF16*int8 + int8 using this IP ? #103
- how complicated would it be add FP8 E3M4 and E2M5 support to this IP? HOT 2
- DC Synthesis for cvfpu (fpnew) occurs fatal error HOT 4
- [Bug] Incorrect Accumulation of ‘OF’ Flag in fflags After Executing fsqrt.d on Infinity HOT 1
- [BUG] Incorrect Result from 'fdiv' Operation Leading to Negative Infinity Instead of Smallest Negative Number
- [BUG] Incorrect Accumulation of ‘OF’ Flag in fflags After Executing fsqrt.d on Infinity
- [BUG] Unexpected Rounding Behavior During fsqrt.d Execution
- NONCOMP clears the result bit for signaling NaNs in "not equal" compare HOT 1
- SQRT operation for FP16ALT only works when all op[n] lanes are assigned to the same input
- Unexpected Result When fsqrt.s Processes Negative Floating-Point Numbers HOT 4
- fdiv incorrectly returns infinity when dividing by NaN HOT 3
- [BUG] Incorrect fflags Set When Using fdiv Instruction to Divide by Infinity
- Conversion from FP32 -2^31 to INT32 sets NV status HOT 5
- Bug report: FSQRT of non-canonical NaN gives valid large floats
- Bug report: fdiv.s taking two NaN may return a valid number and is not always the consequence of a wrong rounding
- Bug report: multifmt slice uses wrong FP width for third operand HOT 3
- Underflow flag not set at subnormal/normal boundary HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvfpu.