This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix setup of MSVC specific intrinsics in Ryu code
ClosedPublic

Authored by mstorsjo on Feb 12 2022, 12:09 PM.

Details

Summary

This fixes warnings about implicitly declared _umul128 and
__shiftright128 when building for x86_64 with clang-cl.

Use _MSC_VER instead of _LIBCPP_COMPILER_MSVC for enabling MSVC
specific code; _MSC_VER is defined both in clang-cl and MSVC,
while _LIBCPP_COMPILER_MSVC only is defined if building with the
actual MSVC compiler.

Include ryu.h at the head of d2s_intrinsics.h, as it uses
the _LIBCPP_64_BIT define, which is defined in ryu.h.

Now the Ryu files build without warnings with clang-cl for i386,
x86_64, arm and aarch64.

Diff Detail

Event Timeline

mstorsjo created this revision.Feb 12 2022, 12:09 PM
mstorsjo requested review of this revision.Feb 12 2022, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2022, 12:09 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision as: Mordante.Feb 14 2022, 9:08 AM

Thanks for the fixes, LGTM!

ldionne accepted this revision.Feb 14 2022, 10:01 AM
This revision is now accepted and ready to land.Feb 14 2022, 10:01 AM