32-bit count-leading-zeroes function: use the Assembly instruction whenever possible. */
| 8025 | |
| 8026 | /* 32-bit count-leading-zeroes function: use the Assembly instruction whenever possible. */ |
| 8027 | uint32_t clz32(uint32_t inp) |
| 8028 | { |
| 8029 | /* slow default version */ |
| 8030 | uint32_t summa = 24; |
| 8031 | if (inp >= (uint32_t)(0x10000)) |
| 8032 | { |
| 8033 | inp >>= 16; |
| 8034 | summa -= 16; |
| 8035 | } |
| 8036 | if (inp >= (uint32_t)(0x100)) |
| 8037 | { |
| 8038 | inp >>= 8; |
| 8039 | summa -= 8; |
| 8040 | } |
| 8041 | return summa + clz_table[inp]; |
| 8042 | } |
| 8043 | |
| 8044 | /* convert from FP16 to FP32. */ |
| 8045 | CGU_UINT sf16_to_sf32(CGU_SHORT inp) |
no outgoing calls
no test coverage detected