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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 13 15:37:08 PST 2018


rnk added a comment.

In D55677#1330559 <https://reviews.llvm.org/D55677#1330559>, @craig.topper wrote:

> yeah I'm now realizing that gcc does implement __lzcnt16 and __lzcnt64. How do I make this work? I tried guarding them with _MSC_VER, but I got redefinition errors on a couple tests from that. Does -ms-extensions not define _MSC_VER?


I don't recall the details, but I suppose it's possible to get into that situation.

It'd be nice to have the builtin be the one true implementation, even with -fno-ms-extensions, but I don't see how to arrange things such that it's available only on x86 or any Windows target.


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

https://reviews.llvm.org/D55677





More information about the cfe-commits mailing list