SIMD ISAReturn TypeNameArgumentsInstruction Group
Neonint16x4_tvcls_u16(uint16x4_t a)Bit manipulation / Count leading sign bits
Description
Count Leading Sign bits (vector). This instruction counts the number of consecutive bits following the most significant bit that are the same as the most significant bit in each vector element in the source SIMD&FP register, places the result into a vector, and writes the vector to the destination SIMD&FP register. The count does not include the most significant bit itself.
Results
Vd.4H result
This intrinsic compiles to the following instructions:

CLS Vd.4H,Vn.4H

Argument Preparation
a register: Vn.4H
Architectures
v7, A32, A64

Operation

CheckFPAdvSIMDEnabled64();
bits(datasize) operand = V[n];
bits(datasize) result;

integer count;
for e = 0 to elements-1
    if countop == CountOp_CLS then
        count = CountLeadingSignBits(Elem[operand, e, esize]);
    else
        count = CountLeadingZeroBits(Elem[operand, e, esize]);
    Elem[result, e, esize] = count<esize-1:0>;
V[d] = result;