Previously we calculating the remainder by multiplying the
quotient and divisor and subtracting from the dividend.
__udivmod can calculate the remainder while calculating the
quotient. We just need to correct the sign afterward.
Paths
| Differential D87433
[builtins] Write __divmoddi4/__divmodsi4 in terms __udivmod instead of __div and multiply. ClosedPublic Authored by craig.topper on Sep 9 2020, 10:20 PM.
Details Summary Previously we calculating the remainder by multiplying the __udivmod can calculate the remainder while calculating the
Diff Detail
Event Timeline
This revision is now accepted and ready to land.Sep 10 2020, 12:07 AM This revision was landed with ongoing or failed builds.Sep 10 2020, 8:10 AM Closed by commit rGf5ad9c2e0ea6: [builtins] Write __divmoddi4/__divmodsi4 in terms __udivmod instead of __div… (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 290872 compiler-rt/lib/builtins/divmoddi4.c
compiler-rt/lib/builtins/divmodsi4.c
|
clang-format: please reformat the code