0bd17e1f5b4df3b3fa4195e6885685935e09f960
[riscv-isa-sim.git] / softfloat / s_countLeadingZeros32.c
1
2 #include <stdint.h>
3 #include "primitives.h"
4
5 int softfloat_countLeadingZeros32( uint32_t a )
6 {
7 int count;
8
9 count = 0;
10 if ( a < 0x10000 ) {
11 count = 16;
12 a <<= 16;
13 }
14 if ( a < 0x1000000 ) {
15 count += 8;
16 a <<= 8;
17 }
18 count += softfloat_countLeadingZeros8[ a>>24 ];
19 return count;
20
21 }
22