SIMD ISAReturn TypeNameArgumentsInstruction Group
Neonint8x16_tvclsq_s8(int8x16_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.16B result
This intrinsic compiles to the following instructions:

CLS Vd.16B,Vn.16B

Argument Preparation
a register: Vn.16B
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;