Page 370 - ARM 64 Bit Assembly Language
P. 370

360 Chapter 10

                  10.6.8.1 Syntax

                       cl(s|z)      Vd.T, Vm.T
                       cnt          Vd.Tn, Vm.Tn

                  •  T must be 8b, 16b, 4h, 8h, 2s,or 4s.
                  •  Tn must be 8b or 16b.

                  10.6.8.2 Operations

                   Name     Effect                               Description
                   cls      n ← # of elements                    Count the number of consecutive
                            for 0 ≤ i< n) do                     bits that are the same as the sign bit
                              Vd[i]←                             for each element in Fm, and store the
                                leading_sign_bits(Vm[i])         counts in the corresponding elements
                            end for                              of Fd.
                   clz      n ← # of elements                    Count the number of leading zero bits
                            for 0 ≤ i< n) do                     for each element in Fm, and store the
                              Vd[i]←                             counts in the corresponding elements
                                leading_zero_bits(Vm[i])         of Fd.
                            end for
                   cnt      n ← # of elements                    Count the number of bits in Fm that
                            for 0 ≤ i< n) do                     are set to one, and store the counts in
                              Vd[i]←                             the corresponding elements of Fd.
                                count_one_bits(Vm[i])
                            end for

                  10.6.8.3 Examples

                1     cls   v1.4s,v6.4s  // Count leading sign bits
                2     cnt   v0.8b,v4.8b  // Count bits that are 1


                  10.6.9 Scalar saturating operations

                  The following instructions perform basic saturating operations on scalars:

                  qadd      Scalar saturating add,
                  qsub      Scalar saturating subtract,
                  qdmulh    Scalar saturating multiply (high half), and
                  qshl      Scalar saturating shift left.
   365   366   367   368   369   370   371   372   373   374   375