Page MenuHomePhabricator

Add __divmodti4 to match libgcc.
ClosedPublic

Authored by craig.topper on May 24 2020, 10:55 PM.

Details

Summary

gcc has used this on x86-64 since at least version 7.

Diff Detail

Event Timeline

craig.topper created this revision.May 24 2020, 10:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2020, 10:55 PM
Herald added subscribers: Restricted Project, mgorny. · View Herald Transcript
MaskRay added inline comments.Mon, Sep 7, 4:54 PM
compiler-rt/test/builtins/Unit/divmodti4_test.c
27

Some existing builtins files do not strictly stick with the style but newer tests should place { at the line end.

62

The values can be organized as an array of structures.

MaskRay added inline comments.Mon, Sep 7, 4:59 PM
compiler-rt/test/builtins/Unit/divmodti4_test.c
85

There is no test where the divisor has its high bits set. Will be good adding some coverage here.

craig.topper added inline comments.Mon, Sep 7, 6:05 PM
compiler-rt/test/builtins/Unit/divmodti4_test.c
85

You mean just the high bit set?

MaskRay added inline comments.Mon, Sep 7, 6:38 PM
compiler-rt/test/builtins/Unit/divmodti4_test.c
85

The high word. All the existing tests set the high word to 0.

craig.topper added inline comments.Mon, Sep 7, 6:51 PM
compiler-rt/test/builtins/Unit/divmodti4_test.c
85

Don't the -1, -2, -3 divisors set the high bit of the high word?

Move test cases into an array.

MaskRay accepted this revision.Wed, Sep 16, 8:04 AM
This revision is now accepted and ready to land.Wed, Sep 16, 8:04 AM
This revision was landed with ongoing or failed builds.Wed, Sep 16, 9:56 PM
This revision was automatically updated to reflect the committed changes.