-
Notifications
You must be signed in to change notification settings - Fork 32
Extensive fp cleanup, support Inf/NaN, addition of simple fp multiplier #152
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments coming, first batch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
lib/src/arithmetic/floating_point/floating_point_adder_round.dart
Outdated
Show resolved
Hide resolved
lib/src/arithmetic/values/floating_point_values/floating_point_8_value.dart
Outdated
Show resolved
Hide resolved
test/arithmetic/floating_point/floating_point_adder_simple_test.dart
Outdated
Show resolved
Hide resolved
test/arithmetic/floating_point/floating_point_multiplier_test.dart
Outdated
Show resolved
Hide resolved
lib/src/arithmetic/floating_point/floating_point_adder_simple.dart
Outdated
Show resolved
Hide resolved
lib/src/arithmetic/floating_point/floating_point_adder_simple.dart
Outdated
Show resolved
Hide resolved
lib/src/arithmetic/floating_point/floating_point_multiplier_simple.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Description & Motivation
Addition of FloatingPointMultiplierSimple class.
Refactor floating point adders to use a base FloatingPointAdder class.
Exhaustive testing expanded to all possible inputs, validating the expected Infinite and NaN cases for FloatingPointAdderSimple,
FloatingPointAdderRound, and FloatingPointMultiplierSimple. Fixed FloatingPointValue to appropriately test Inf and NaN. Fixed the narrow-width FP special cases (e.g. FP8E4M3 does not support NaN).
Pipelined all three fp components.
Added a NativeAdder to use as a functor to use synthesized adders where convenient.
Added a SignedShifter component.
Modified PrefixTreePriorityEncoder to return the position 1 larger than the input width if no '1' exists in the input.
Optionally output a sentinal to indicate this as well. This is used in the fp adders.
Related Issue(s)
#133
#127 This is a proposed solution to use sentinals.
Testing
Exhaustive and random tests for all new components except the SignedShifter (used in fp multiplier).
Backwards-compatibility
Yes: PrefixTreePriorityEncoder used to return position 0 when input was all zeros. Now it returns input.width+1 and sets the sentinal.
Documentation
Yes. The NativeAdder is documented. The new FloatingPointMultiplierSimple needs documentation as well as a mention of pipelining in the FloatingPointAdderSimple. Need to check the PrefixTreePriorityFinder MD file for updates.