MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / clz32

Function clz32

Source/astcenc_mathlib_softfloat.cpp:37–46  ·  view source on GitHub ↗

Idiomatic count-leading zeros, generates native instruction on modern compilers. */

Source from the content-addressed store, hash-verified

35
36/* Idiomatic count-leading zeros, generates native instruction on modern compilers. */
37static uint32_t clz32(uint32_t inp)
38{
39 uint32_t count = 32;
40 while (inp)
41 {
42 inp >>= 1;
43 count--;
44 }
45 return count;
46}
47
48/* the five rounding modes that IEEE-754r defines */
49typedef enum

Callers 1

sf16_to_sf32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected