world leader in high performance signal processing
Trace: » ones

ONES (One’s-Population Count)

General Form

dest_reg = ONES src_reg


Dreg_lo = ONES Dreg ; /* (b) */

Syntax Terminology


Instruction Length

In the syntax, comment (b) identifies 32-bit instruction length.

Functional Description

The One’s-Population Count instruction loads the number of 1’s contained in the src_reg into the lower half of the dest_reg.

The range of possible values loaded into dest_reg is 0 through 32.

The dest_reg and src_reg can be the same D-register. Otherwise, the One’s-Population Count instruction does not modify the contents of src_reg.

Flags Affected


The ADSP-BF535 processor has fewer ASTAT flags and some flags operate differently than subsequent Blackfin family products. For more information on the ADSP-BF535 status flags, see Table A-1 on page A-3.

Required Mode

User & Supervisor

Parallel Issue

This instruction can be issued in parallel with specific other 16-bit instructions. For details, see “Issuing Parallel Instructions” on page 20-1.


r3.l = ones r7 ;

If R7 contains 0xA5A5A5A5, R3.L contains the value 16, or 0x0010.

If R7 contains 0x00000081, R3.L contains the value 2, or 0x0002.

Also See


Special Applications

Software parity testing