Implement addtf3 and subtf3, which performs long double addition and substraction
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Please just hardcode the expected results and compare them by using *integer* operations (or other runtime functions, if we have suitable ones).
test/builtins/Unit/addtf3_test.c | ||
---|---|---|
43–44 ↗ | (On Diff #7226) | It can be. Just compare the binary representation. |
test/builtins/Unit/addtf3_test.c | ||
---|---|---|
21–57 ↗ | (On Diff #7329) | Please don't duplicate these helpers, factor them out to a shared header. |
83 ↗ | (On Diff #7329) | It would be easier to read these tests if in addition to fromRep() there were makePlusInf(), makeQNaN() etc. |
test/builtins/Unit/subtf3_test.c | ||
21–32 ↗ | (On Diff #7329) | Even though there is no intention of breaking this union trick in Clang, it is undefined behavior. The correct way to do this is to use memcpy() to copy from long double* to __uint128_t*. |
Sorry for leaving this hanging so long. Can you just commit the refactoring of addsf3.c / adddf3.c first without changing the comment style?
The file diff should be just the constant translation. Adding the tf frontend with the test cases is fine after that.
I'm unfamiliar with this review system... is this just waiting for someone to submit?