This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add __popcntd and __popcntq to ia32intrin.h to match gcc and icc. Remove popcnt feature flag from _popcnt32/_popcnt64 and move to ia32intrin.h to match gcc
ClosedPublic

Authored by craig.topper on Mar 19 2019, 3:52 PM.

Details

Summary

gcc and icc both implement popcntd and popcntq which we did not. gcc doesn't seem to require a feature flag for the _popcnt32/_popcnt64 spelling and will use a libcall if its not supported.

Diff Detail

Repository
rC Clang

Event Timeline

craig.topper created this revision.Mar 19 2019, 3:52 PM

IIRC we don't use libcalls for popcnt - we just expand

clang/lib/Headers/ia32intrin.h
35 ↗(On Diff #191411)

Change this as we don't require POPCNT any more?

Update doxygen comments

IIRC we don't use libcalls for popcnt - we just expand

Yeah we expand. gcc uses libcall. I think icc also expands.

RKSimon accepted this revision.Mar 21 2019, 7:25 AM

LGTM with some minor typos

lib/Headers/ia32intrin.h
36

calculate

57

calculate

This revision is now accepted and ready to land.Mar 21 2019, 7:25 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2019, 10:43 AM