Skip to content

Update popcnt16-popcnt-popcnt64.md #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/intrinsics/popcnt16-popcnt-popcnt64.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ms.assetid: e525b236-adc8-42df-9b9b-8b7d8c245d3b

**Microsoft Specific**

Counts the number of one bits (population count) in a 16-, 32-, or 64-byte unsigned integer.
Counts the number of one bits (population count) in a 16-, 32-, or 64-bit unsigned integer.

## Syntax

Expand Down Expand Up @@ -46,7 +46,7 @@ The number of one bits in the `value` parameter.

## Remarks

Each of these intrinsics generates the `popcnt` instruction. The size of the value that the `popcnt` instruction returns is the same as the size of its argument. In 32-bit mode there are no 64-bit general-purpose registers, hence no 64-bit `popcnt`.
Each of these intrinsics generates the `popcnt` instruction. In 32-bit mode there are no 64-bit general-purpose registers, hence no 64-bit `popcnt`.

To determine hardware support for the `popcnt` instruction, call the `__cpuid` intrinsic with `InfoType=0x00000001` and check bit 23 of `CPUInfo[2] (ECX)`. This bit is 1 if the instruction is supported, and 0 otherwise. If you run code that uses this intrinsic on hardware that does not support the `popcnt` instruction, the results are unpredictable.

Expand Down