ScalarCountLeadingZero
Applicability
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
x |
|
x |
Function Usage
Computes the number of leading 0s of a uint64_t number (number of 0s from the most significant bit to the first 1 in the binary number).
Prototype
1 | __aicore__ inline int64_t ScalarCountLeadingZero(uint64_t valueIn) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
valueIn |
Input |
A binary number. |
Returns
Return the number of leading zeros in valueIn.
Constraints
None
Example
1 2 3 | uint64_t valueIn = 0x0fffffffffffffff; // Output (ans): 4 int64_t ans = AscendC::ScalarCountLeadingZero(valueIn); |
Parent topic: Scalar Computation