The implementation is not fully standards compliant in the sense that
errno is not set on error, and floating point exceptions are not raised.
Subnormal range and normal range are tested separately in the tests.
Paths
| Differential D86666
[libc] Add implementations of remquo[f|l] and remainder[f|l]. ClosedPublic Authored by sivachandra on Aug 26 2020, 5:11 PM.
Details Summary The implementation is not fully standards compliant in the sense that Subnormal range and normal range are tested separately in the tests.
Diff Detail
Event Timeline
This revision is now accepted and ready to land.Sep 3 2020, 9:43 PM This revision was landed with ongoing or failed builds.Sep 3 2020, 10:00 PM Closed by commit rG8514ecb02d43: [libc] Add implementations of remquo[f|l] and remainder[f|l]. (authored by sivachandra). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 289866 libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/spec/stdc.td
libc/src/math/CMakeLists.txt
libc/src/math/remainder.h
libc/src/math/remainder.cpp
libc/src/math/remainderf.h
libc/src/math/remainderf.cpp
libc/src/math/remainderl.h
libc/src/math/remainderl.cpp
libc/src/math/remquo.h
libc/src/math/remquo.cpp
libc/src/math/remquof.h
libc/src/math/remquof.cpp
libc/src/math/remquol.h
libc/src/math/remquol.cpp
libc/test/src/math/CMakeLists.txt
libc/test/src/math/remquo_test.cpp
libc/test/src/math/remquof_test.cpp
libc/test/src/math/remquol_test.cpp
libc/utils/FPUtil/CMakeLists.txt
libc/utils/FPUtil/DivisionAndRemainderOperations.h
libc/utils/FPUtil/FPBits.h
libc/utils/FPUtil/LongDoubleBitsX86.h
|
When the remainder is in the subnormal range, I think the final check below is correct, but with an implicit assumption that the rounding from NormalFloat<T> to T is truncation.
Can you add that to comments, in case we change the rounding NormalFloat<T> to T to the default round-to-nearest, tie-to-even? So that at least we will add more tests for subnormal range to make sure that it still works correctly, even when NormalFloat<T> rounding is updated.