projects
/
riscv-isa-sim.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge softfloat_riscv into softfloat
[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