Implementing fdim, fdimf, and fdiml for llvm-libc.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/test/src/math/FDimTest.h | ||
---|---|---|
15 | To be consistent with other places, do not put the test classes in the any namespace. | |
24 | Can you move this declaration out of the method? This way, other methods can also use them without redeclarations? | |
libc/test/src/math/fdim_test.cpp | ||
17 | We don't need these. I will clean it up in the ilogb tests. | |
libc/utils/FPUtil/BasicOperations.h | ||
78 | The operation x - y can lead to overflow or underflow. Shouldn't we detect that and return the appropriate value as specified by the standard? Or, should we assume that the machine instruction does the right thing? |
libc/test/src/math/FDimTest.h | ||
---|---|---|
24 | FPBits class cannot be constexpr yet, so we cannot have these constants as static members of the class yet. I moved them out as const members instead. | |
libc/utils/FPUtil/BasicOperations.h | ||
78 | We are assuming CPU's supporting IEEE 754 arithmetic, so the machine instruction will do the right thing. For example the spec specified to return HUGE_VAL in case of overflow, which is resolved to inf for IEEE 754 standard. |
libc/test/src/math/FDimTest.h | ||
---|---|---|
24 | LGTM. | |
libc/utils/FPUtil/BasicOperations.h | ||
78 | SGTM. So, in general, out position is: If we use a language operator for a floating point operation, then we assume that the machine instruction (or instructions) implementing the operator conform to the IEEE-754 standard. Does that sound reasonable? |
libc/utils/FPUtil/BasicOperations.h | ||
---|---|---|
78 | SGTM |
To be consistent with other places, do not put the test classes in the any namespace.