Page MenuHomePhabricator

[7/N] [libcxx] Don't use __int128 for msvc targets
Needs RevisionPublic

Authored by mstorsjo on Tue, Nov 10, 1:36 AM.

Details

Reviewers
rnk
ldionne
amccarth
EricWF
Group Reviewers
Restricted Project
Summary

While clang-cl can compile it just fine, the compiler support lib lacks support for it (as compiler-rt builtins aren't used).

This means that file_time_type has a shorter range on this target (+/- 292 years from the epoch). This is smaller than the range of the windows native file time type (which is 64 bit, with a 100 ns unit, from an epoch of year 1601), but covers the practically used range just fine. See docs/DesignDocs/FileTimeType.rst for more of the tradeoffs this means.

Diff Detail

Event Timeline

mstorsjo created this revision.Tue, Nov 10, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Nov 10, 1:36 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
mstorsjo requested review of this revision.Tue, Nov 10, 1:36 AM
ldionne requested changes to this revision.Tue, Nov 10, 8:41 AM
ldionne added a subscriber: ldionne.

This influences the ABI IIRC, so this choice may be forever. Shouldn't we fix the compiler support lib on Windows instead?

This revision now requires changes to proceed.Tue, Nov 10, 8:41 AM

This influences the ABI IIRC, so this choice may be forever.

Well afaik the ABI of libc++ on windows is rather non-fixed so far anyway

Shouldn't we fix the compiler support lib on Windows instead?

The thing is, in setups when building with clang-cl, i.e. clang operating in MSVC mode, we only use the MSVC provided support libs, so there's not much we can fix ourselves there.

@rnk, @thakis, what do you guys think?

I guess the alternative is to lift implementations of __divti3 and __udivti3 from compiler-rt and place in libcxx/src/filesystem - there's already a copy of __muloti4 there, due to libgcc missing it, and we could provide those other two as well, for msvc builds.

I guess the alternative is to lift implementations of __divti3 and __udivti3 from compiler-rt and place in libcxx/src/filesystem - there's already a copy of __muloti4 there, due to libgcc missing it, and we could provide those other two as well, for msvc builds.

Made such an alternative fix in D91413.