Obtains the position where the first 0 or 1 appears in a binary number of the uint64_t type. The index starts from the least significant bit (index 0). If no 0 or 1 is found, -1 is returned. When the countValue parameter is set to 1, the position of the first 1 is searched for. When the countValue parameter is set to 0, the position of the first 0 is searched for. This function is often used in scenarios such as bit operation optimization and data compression algorithms to improve processing efficiency.
template <int countValue> __aicore__ inline int64_t ScalarGetSFFValue(uint64_t valueIn)
Table 1 Parameters
| Parameter | Input/Output | Description |
|---|---|---|
| valueIn | Input | Input data of the uint64_t type. |
| countValue | Input | Location of the first 0 or 1. The data type is int, and the value is 0 or 1. |