projects
/
gcc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
8540.md: New file.
[gcc.git]
/
gcc
/
config
/
udivmodsi4.c
1
unsigned long
2
udivmodsi4
(
unsigned long
num
,
unsigned long
den
,
int
modwanted
)
3
{
4
unsigned long
bit
=
1
;
5
unsigned long
res
=
0
;
6
7
while
(
den
<
num
&&
bit
&& !(
den
& (
1L
<<
31
)))
8
{
9
den
<<=
1
;
10
bit
<<=
1
;
11
}
12
while
(
bit
)
13
{
14
if
(
num
>=
den
)
15
{
16
num
-=
den
;
17
res
|=
bit
;
18
}
19
bit
>>=
1
;
20
den
>>=
1
;
21
}
22
if
(
modwanted
)
return
num
;
23
return
res
;
24
}