[llvm] [APFloat] Add APFloat support for E8M0 type (PR #107127)
Durgadoss R via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 05:28:19 PDT 2024
================
@@ -1165,7 +1200,7 @@ IEEEFloat::IEEEFloat(const fltSemantics &ourSemantics, integerPart value) {
IEEEFloat::IEEEFloat(const fltSemantics &ourSemantics) {
initialize(&ourSemantics);
- makeZero(false);
+ ourSemantics.hasZero ? makeZero(false) : makeSmallestNormalized(false);
----------------
durga4github wrote:
The Float8E8M0FNU format does not have a representation for zero. So, we are initializing with the closest possible representation (which happens to be the smallestNormalized for this format).
Zero is special with its own 'fcZero' category. Since we have a normal value here, we cannot use makeZero() to initialize it. (i.e. we need this to be categorized as 'fcNormal' and not as 'fcZero').
I have added a comment regarding this in the latest revision.
https://github.com/llvm/llvm-project/pull/107127
More information about the llvm-commits
mailing list