O'Reilly logo

Modern Assembly Language Programming with the ARM Processor by Larry D. Pyeatt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

Syntax

 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
vcnti8

Operations

NameEffectDescription
vcls

n# of elementssi52_e

for 0 ≤ i < n) do

 Vd[i]leading_sign_bits(Vm[i])si161_e

end for

Count the number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required