URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 38 |
Rev 154 |
long udivmodsi4 ();
|
long udivmodsi4 ();
|
|
|
long
|
long
|
__divsi3 (long a, long b)
|
__divsi3 (long a, long b)
|
{
|
{
|
int neg = 0;
|
int neg = 0;
|
long res;
|
long res;
|
|
|
if (a < 0)
|
if (a < 0)
|
{
|
{
|
a = -a;
|
a = -a;
|
neg = !neg;
|
neg = !neg;
|
}
|
}
|
|
|
if (b < 0)
|
if (b < 0)
|
{
|
{
|
b = -b;
|
b = -b;
|
neg = !neg;
|
neg = !neg;
|
}
|
}
|
|
|
res = udivmodsi4 (a, b, 0);
|
res = udivmodsi4 (a, b, 0);
|
|
|
if (neg)
|
if (neg)
|
res = -res;
|
res = -res;
|
|
|
return res;
|
return res;
|
}
|
}
|
|
|
long
|
long
|
__modsi3 (long a, long b)
|
__modsi3 (long a, long b)
|
{
|
{
|
int neg = 0;
|
int neg = 0;
|
long res;
|
long res;
|
|
|
if (a < 0)
|
if (a < 0)
|
{
|
{
|
a = -a;
|
a = -a;
|
neg = 1;
|
neg = 1;
|
}
|
}
|
|
|
if (b < 0)
|
if (b < 0)
|
b = -b;
|
b = -b;
|
|
|
res = udivmodsi4 (a, b, 1);
|
res = udivmodsi4 (a, b, 1);
|
|
|
if (neg)
|
if (neg)
|
res = -res;
|
res = -res;
|
|
|
return res;
|
return res;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.