This commit is contained in:
Steve Chamberlain 1993-06-18 20:53:58 +00:00
parent 3681a95291
commit fdc506e668

View File

@ -181,7 +181,8 @@ now_persec ()
static FILE *profile_file;
static void swap(b,n)
static void
swap (b, n)
unsigned char *b;
int n;
{
@ -190,7 +191,8 @@ static void swap(b,n)
b[2] = n >> 8;
b[3] = n >> 0;
}
static void swap16(b,n)
static void
swap16 (b, n)
unsigned char *b;
int n;
{
@ -381,72 +383,48 @@ div1 (R, iRn2, iRn1, T)
return T;
}
#if 0
old_q = Q;
Q = (R[n]&0x80000000) != 0;
R[n] <<= 1;
R[n] |= T;
tmp0 = R[n];
if (M==old_q)
{
R[n] -= R[m];
tmp1 = (R[n] > tmp0) != Q;
T = 1;
}
else
{
R[n] += R[m];
tmp1 = (R[n] < tmp0) == Q;
T = 0;
}
return T;
}
#endif
static void dmul(sign, rml, rnl)
static void
dmul (sign, rm, rn)
int sign;
unsigned int rml;
unsigned int rnl;
unsigned int rm;
unsigned int rn;
{
unsigned int rmh;
unsigned int rnh;
unsigned long RnL, RnH;
unsigned long RmL, RmH;
unsigned long temp0, temp1, temp2, temp3;
unsigned long Res2, Res1, Res0;
unsigned int t0,t1,t2,t3;
unsigned int res0,res1,res2;
/* Sign extend input if signed multiply */
if (sign)
if (!sign)
{
rmh = (rml & 0x80000000) ? ~0 : 0;
rnh = (rnl & 0x80000000) ? ~0 : 0;
RnL = rn & 0xffff;
RnH = (rn >> 16) & 0xffff;
RmL = rm & 0xffff;
RmH = (rm >> 16) & 0xffff;
temp0 = RmL * RnL;
temp1 = RmH * RnL;
temp2 = RmL * RnH;
temp3 = RmH * RnH;
Res2 = 0;
Res1 = temp1 + temp2;
if (Res1 < temp1)
Res2 += 0x00010000;
temp1 = (Res1 << 16) & 0xffff0000;
Res0 = temp0 + temp1;
if (Res0 < temp0)
Res2 += 1;
Res2 += ((Res1 >> 16) & 0xffff) + temp3;
MACH = Res2;
MACL = Res0;
}
else
{
rmh = 0;
rnh = 0;
abort ();
}
t0 = rml *rnl;
t1 = rmh *rnl;
t2 = rml*rnh;
t3 = rmh*rnh;
res2 = 0;
res1 = t1+t2;
if (res1 < t1)
res2 += 0x00010000;
t1 = ((res1 << 16) & 0xffff0000);
res0 = t0 + t1;
if (res0 < t0) res2++;
res2 = res2 + ((res1 >> 16) & 0xffff) + t3;
MACH = res2;
MACL = res0;
}
@ -538,7 +516,8 @@ dump_profile()
}
static int gotcall(from, to)
static int
gotcall (from, to)
int from;
int to;
{