10.9.8 Count Bits

These instructions can be used to count leading sign bits or zeros, or to count the number of bits that are set for each element in a vector:

vcls Count Leading Sign Bits

vclz Count Leading Zero Bits

vcnt Count Set Bits


 v<op>.<type> Vd, Vm

 <op> is either cls, clz or cnt.

 The valid choices for <type> are given in the following table:

OpcodeValid Types
vclss8, s16, or s32
vclzu8, u16, or u32



n# of elementssi52_e

for 0 ≤ i < n) do


end for

Count the number ...

Get Modern Assembly Language Programming with the ARM Processor now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.