In the same way that get_explicit_mantissa is used to get the mantissa
with all the implicit bits spelled out, get_explicit_exponent gives you
the exponent with the special cases handled. Mainly it handles the cases
where the exponent is zero, which causes the exponent to either be 1
higher than expected, or just 0.
Details
- Reviewers
lntue sivachandra - Commits
- rG455d678019d8: [libc] Add get_explicit_exponent to fpbits
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/__support/FPUtil/x86_64/LongDoubleBits.h | ||
---|---|---|
150 | In most of the conventions for floating point exponents, zeros are often grouped together with denormal numbers. Unless it's used in more places, do you think the logic that requires different ways of handling exponents of zeros can be put locally to those functions? |
libc/src/__support/FPUtil/x86_64/LongDoubleBits.h | ||
---|---|---|
150 | We can handle subnormals and zero in the individual places, that's what I was doing before, but I added this function because I realized it was repeated. Regardless of if we add the new function, we should keep the change for long double get_exponent because otherwise it behaves differently from other float types. |
In most of the conventions for floating point exponents, zeros are often grouped together with denormal numbers. Unless it's used in more places, do you think the logic that requires different ways of handling exponents of zeros can be put locally to those functions?