[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-09-01 Thread Anatoly Trosinenko via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0e90d8d4fed8: [builtins] Unify the softfloat division implementation (authored by atrosinenko). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a comment. Thank you very much for review! I have amended this diff based on the latest comment by @scanon. So, I will land D85031 and then D85032: [builtins] Make divXf3 handle denormal results if there are

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 289022. atrosinenko added a comment. Update after the latest comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/lib/builtins/divdf3.c

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:109 + +#if NUMBER_OF_HALF_ITERATIONS > 0 + // Starting with (n-1) half-width iterations scanon wrote: > sepavloff wrote: > > atrosinenko wrote: > > > sepavloff wrote: > > > > I

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:99 + // 0 < x0(b) < 1 + // abs(x0(b) - 1/b) <= 3/4 - 1/sqrt(2) + sepavloff wrote: > atrosinenko wrote: > > sepavloff wrote: > > > This estimation is absent from the original

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 288932. atrosinenko added a comment. Clarify rounding-related part of function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/lib/builtins/di

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-31 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. The new comments are much better, thank you! I think this version may be committed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 ___

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-30 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 288850. atrosinenko added a comment. Herald added a subscriber: danielkiss. Add more clarifications, fix explanation for "why it is enough to adjust only once in case of overflow". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-28 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 288623. atrosinenko added a comment. Add some other explanations. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/lib/builtins/divdf3.c compi

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-28 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 288599. atrosinenko added a comment. This update is expected to be completely NFC w.r.t. code behavior and significantly clarify the proof up to the end of half-width iterations. Particularly, the reasoning about possible overflow of intermediate results

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-27 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added inline comments. Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:142 + // An error due to truncated C + an error due to truncated x_UQ0_hw: + // e_0 <= 3/4 - 1/sqrt(2) + 2^-W0 + 2^-HW + sepavloff wrote: > Should the right part contain `1/

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-27 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 288348. atrosinenko added a comment. No-change re-upload: rebase onto current master branch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/li

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. I don't fully understand the magic of fixing possible overflow, I hope you made enough investigation and testing to be sure it works as expected. Please wait a couple of days befor

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-24 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 287351. atrosinenko added a comment. Addressed the review comments mostly by clarifying the explanations. I expect this code to have no **unresolved** review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:99 + // 0 < x0(b) < 1 + // abs(x0(b) - 1/b) <= 3/4 - 1/sqrt(2) + atrosinenko wrote: > sepavloff wrote: > > This estimation is absent from the original comment. Do you have

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-20 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a comment. //Some general context:// The final goal was to have an explanation why this particular number of iteration (3, 4 or 5, depending on type) are enough for any `a` and `b` passed as input arguments taking into account errors due to particular finite precision computat

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:99 + // 0 < x0(b) < 1 + // abs(x0(b) - 1/b) <= 3/4 - 1/sqrt(2) + This estimation is absent from the original comment. Do you have reference where it came from? Also the o

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-19 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 286516. atrosinenko added a comment. Rebase the entire patch stack against the up-to-date master and re-upload. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 File

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-13 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-12 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a comment. On linter diagnostics: error messages are due to linter trying to lint `*.inc` file that is not self-contained by design. D85731: [builtins] Make softfloat-related errors less noisy tries to make those errors more meaningful, at lea

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-11 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 284777. atrosinenko added a comment. Re-upload after D85731: [builtins] Make softfloat-related errors less noisy to get rid of "error: unknown type name 'fp_t'" and similar clang-tidy diagnostics for `fp_div_impl.inc`.

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-08-11 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 284623. atrosinenko added a comment. Refactoring Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/lib/builtins/divdf3.c compiler-rt/lib/builti

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-07-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a comment. Here are the benchmark and fuzzing harness used to test this patch. F12453076: fuzz_divXf3.sh F12453075: divXf3_fuzzer.c F12453074: bench_divXf3.sh F12453

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-07-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko updated this revision to Diff 282225. atrosinenko added a comment. Revert auto-linting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85031/new/ https://reviews.llvm.org/D85031 Files: compiler-rt/lib/builtins/divdf3.c compiler-rt/li

[PATCH] D85031: [builtins] Unify the softfloat division implementation

2020-07-31 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko created this revision. atrosinenko added reviewers: koviankevin, joerg, efriedma, compnerd, scanon. Herald added a project: Sanitizers. Herald added a subscriber: Sanitizers. atrosinenko requested review of this revision. atrosinenko updated this revision to Diff 282225. atrosinenko add