IBM Extension

POPCNTB(I)

Purpose

Population count.

Counts the number of set bits of each byte in a register.

Valid only on POWER5.

Class

Elemental function.

Argument type and attributes

I
An INTENT(IN) argument of type INTEGER(4) in 32-bit mode.

An INTENT(IN) argument of type INTEGER(4) or INTEGER(8) in 64-bit mode

Result type and attributes

Returns an INTEGER(4) in 32-bit mode.

Returns an INTEGER(8) in 64-bit mode.

Result value

The number of bits set to on in that byte, in the position of the byte.

Examples

INTEGER I
I = x'010300ff'
WRITE(*, '(z8.8)') POPCNTB(I)
END

Expected output:

01020008

Related information

Data representation models

End of IBM Extension