mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
1952e2e1c1
These bits are taken from the FSF anoncvs repo on 1-Feb-2002 08:20 PST.
51 lines
491 B
C
51 lines
491 B
C
long udivmodsi4 ();
|
|
|
|
long
|
|
__divsi3 (long a, long b)
|
|
{
|
|
int neg = 0;
|
|
long res;
|
|
|
|
if (a < 0)
|
|
{
|
|
a = -a;
|
|
neg = !neg;
|
|
}
|
|
|
|
if (b < 0)
|
|
{
|
|
b = -b;
|
|
neg = !neg;
|
|
}
|
|
|
|
res = udivmodsi4 (a, b, 0);
|
|
|
|
if (neg)
|
|
res = -res;
|
|
|
|
return res;
|
|
}
|
|
|
|
long
|
|
__modsi3 (long a, long b)
|
|
{
|
|
int neg = 0;
|
|
long res;
|
|
|
|
if (a < 0)
|
|
{
|
|
a = -a;
|
|
neg = 1;
|
|
}
|
|
|
|
if (b < 0)
|
|
b = -b;
|
|
|
|
res = udivmodsi4 (a, b, 1);
|
|
|
|
if (neg)
|
|
res = -res;
|
|
|
|
return res;
|
|
}
|