This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][builtins] {u,}{div,mod}si3 for Sparc64
AbandonedPublic

Authored by brad on May 13 2022, 9:32 PM.

Details

Reviewers
MaskRay
Summary

I have taken the diff provided via this quite old bug report and added the CMake piece. Originally from FreeBSD/sparc64.

https://github.com/llvm/llvm-project/issues/12039

Diff Detail

Event Timeline

brad created this revision.May 13 2022, 9:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 9:32 PM
brad requested review of this revision.May 13 2022, 9:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 9:32 PM
brad updated this revision to Diff 429408.May 13 2022, 9:33 PM

Wrong diff posted.

brad added a subscriber: koakuma.May 13 2022, 9:38 PM

According to a developer at the FreeBSD project, FreeBSD's total compilation time increases by 2.6% when the host system is built against compiler-rt instead of libgcc. This is likely due to the fact that GCC has assembly-written versions of the division and modulo routines, while compiler-rt does not.

Is 2.6% still the case nowadays? It's hard to believe so much compile time is spent on division and modulo routines. We need evidence.

For these routines, ISTM the performance is not the critical part but maintainability is probably the most important metric. We should just use the portable C implementation.

brad abandoned this revision.May 14 2022, 9:46 PM

For these routines, ISTM the performance is not the critical part but maintainability is probably the most important metric. We should just use the portable C implementation.

Ok, I'll drop it for now.