[PATCH] D55677: [Builltins][X86] Provide implementations of __lzcnt16, __lzcnt, __lzcnt64 for MS compatibility. Remove declarations from intrin.h and implementations from lzcntintrin.h

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 13 15:48:02 PST 2018


craig.topper updated this revision to Diff 178155.
craig.topper added a comment.

Replace the versions in lzcntintrin.h with macros that are only defined when _MSC_VER is not defined. This avoids a redefinition error when -ms-extensions is enabled which appears to not set _MSC_VER.

I forgot to mention previously that I changed 'LL' to 'W' in several builtin definitions to match the __int64 that MS documentation says they use.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55677/new/

https://reviews.llvm.org/D55677

Files:
  include/clang/Basic/Builtins.def
  lib/CodeGen/CGBuiltin.cpp
  lib/Headers/intrin.h
  lib/Headers/lzcntintrin.h
  test/CodeGen/ms-intrinsics-other.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55677.178155.patch
Type: text/x-patch
Size: 6749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181213/4fb26ee0/attachment-0001.bin>


More information about the cfe-commits mailing list