Remove unused "dummy" parameters for some functions

This commit is contained in:
Stanislav Shwartsman 2003-10-05 12:26:11 +00:00
parent 9690ed763b
commit 25d04e2b4f
12 changed files with 42 additions and 50 deletions

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| fpu_emu.h |
| $Id: fpu_emu.h,v 1.18 2003-10-04 16:47:57 sshwarts Exp $
| $Id: fpu_emu.h,v 1.19 2003-10-05 12:26:11 sshwarts Exp $
| |
| Copyright (C) 1992,1993,1994,1997 |
| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
@ -181,11 +181,10 @@ asmlinkage int FPU_u_div(FPU_REG const *arg1, FPU_REG const *arg2,
asmlinkage int FPU_u_add(FPU_REG const *arg1, FPU_REG const *arg2,
FPU_REG *answ, u16 control_w, u_char sign,
s32 expa, s32 expb);
asmlinkage int wm_sqrt(FPU_REG *n, int dummy1, int dummy2,
u16 control_w, u_char sign);
asmlinkage int wm_sqrt(FPU_REG *n, u16 control_w, u_char sign);
asmlinkage u32 FPU_shrx(void *l, u32 x);
asmlinkage u32 FPU_shrxs(void *v, u32 x);
asmlinkage int FPU_round(FPU_REG *arg, u32 extent, int dummy,
asmlinkage int FPU_round(FPU_REG *arg, u32 extent,
u16 control_w, u_char sign);
#ifndef MAKING_PROTO

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| fpu_trig.c |
| $Id: fpu_trig.c,v 1.9 2003-10-04 16:47:57 sshwarts Exp $
| $Id: fpu_trig.c,v 1.10 2003-10-05 12:26:11 sshwarts Exp $
| |
| Implementation of the FPU "transcendental" functions. |
| |
@ -361,7 +361,7 @@ static void fptan(FPU_REG *st0_ptr, u_char st0_tag)
FPU_to_exp16(st0_ptr, st0_ptr);
st0_tag = FPU_round(st0_ptr, 1, 0, FULL_PRECISION, arg_sign);
st0_tag = FPU_round(st0_ptr, 1, FULL_PRECISION, arg_sign);
FPU_settag0(st0_tag);
}
FPU_push();
@ -535,7 +535,7 @@ static void fsqrt_(FPU_REG *st0_ptr, u_char st0_tag)
setexponent16(st0_ptr, (expon & 1));
/* Do the computation, the sign of the result will be positive. */
tag = wm_sqrt(st0_ptr, 0, 0, FPU_control_word, SIGN_POS);
tag = wm_sqrt(st0_ptr, FPU_control_word, SIGN_POS);
addexponent(st0_ptr, expon >> 1);
FPU_settag0(tag);
return;
@ -678,7 +678,7 @@ static int fsin(FPU_REG *st0_ptr, u_char tag)
/* Underflow may happen */
FPU_to_exp16(st0_ptr, st0_ptr);
tag = FPU_round(st0_ptr, 1, 0, FULL_PRECISION, arg_sign);
tag = FPU_round(st0_ptr, 1, FULL_PRECISION, arg_sign);
FPU_settag0(tag);
@ -1090,7 +1090,7 @@ static void do_fprem(FPU_REG *st0_ptr, u_char st0_tag, int round)
}
else
{
tag = FPU_round(st0_ptr, 0, 0, FULL_PRECISION, st0_sign);
tag = FPU_round(st0_ptr, 0, FULL_PRECISION, st0_sign);
}
FPU_settag0(tag);
setcc(cc);
@ -1762,7 +1762,7 @@ static void fscale(FPU_REG *st0_ptr, u_char st0_tag)
setexponent16(st0_ptr, scale);
/* Use FPU_round() to properly detect under/overflow etc */
FPU_round(st0_ptr, 0, 0, FPU_control_word, sign);
FPU_round(st0_ptr, 0, FPU_control_word, sign);
return;
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| poly_2xm1.c |
| $Id: poly_2xm1.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
| $Id: poly_2xm1.c,v 1.6 2003-10-05 12:26:11 sshwarts Exp $
| |
| Function to compute 2^x-1 by a polynomial approximation. |
| |
@ -147,7 +147,7 @@ int poly_2xm1(u_char sign, FPU_REG *arg, FPU_REG *result)
significand(result) = XSIG_LL(accumulator);
setexponent16(result, exponent);
tag = FPU_round(result, 1, 0, FULL_PRECISION, sign);
tag = FPU_round(result, 1, FULL_PRECISION, sign);
setsign(result, sign);
FPU_settag0(tag);

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| poly_atan.c |
| $Id: poly_atan.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
| $Id: poly_atan.c,v 1.6 2003-10-05 12:26:11 sshwarts Exp $
| |
| Compute the arctan of a FPU_REG, using a polynomial approximation. |
| |
@ -220,7 +220,7 @@ void poly_atan(FPU_REG *st0_ptr, u_char st0_tag,
significand(st1_ptr) = XSIG_LL(accumulator);
setexponent16(st1_ptr, exponent);
tag = FPU_round(st1_ptr, 1, 0, FULL_PRECISION, sign2);
tag = FPU_round(st1_ptr, 1, FULL_PRECISION, sign2);
FPU_settagi(1, tag);

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| poly_l2.c |
| $Id: poly_l2.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
| $Id: poly_l2.c,v 1.5 2003-10-05 12:26:11 sshwarts Exp $
| |
| Compute the base 2 log of a FPU_REG, using a polynomial approximation. |
| |
@ -103,7 +103,7 @@ void poly_l2(FPU_REG *st0_ptr, FPU_REG *st1_ptr, u_char st1_sign)
significand(st1_ptr) = XSIG_LL(accumulator);
setexponent16(st1_ptr, expon_expon + exponent16(st1_ptr) + 1);
tag = FPU_round(st1_ptr, 1, 0, FULL_PRECISION, sign ^ st1_sign);
tag = FPU_round(st1_ptr, 1, FULL_PRECISION, sign ^ st1_sign);
FPU_settagi(1, tag);
set_precision_flag_up(); /* 80486 appears to always do this */
@ -140,7 +140,7 @@ int poly_l2p1(u_char sign0, u_char sign1,
significand(dest) = XSIG_LL(accumulator);
setexponent16(dest, exponent);
tag = FPU_round(dest, 1, 0, FULL_PRECISION, sign0 ^ sign1);
tag = FPU_round(dest, 1, FULL_PRECISION, sign0 ^ sign1);
FPU_settagi(1, tag);
if ( tag == TAG_Valid )

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_add_sub.c |
| $Id: reg_add_sub.c,v 1.8 2003-10-04 12:32:56 sshwarts Exp $
| $Id: reg_add_sub.c,v 1.9 2003-10-05 12:26:11 sshwarts Exp $
| |
| Functions to add or subtract two registers and put the result in a third. |
| |
@ -412,13 +412,13 @@ int add_sub_specials(FPU_REG const *a, u_char taga, u_char signa,
if ((dest->sigh & 0x80000000) == 0)
{
dest->exp++;
tag = FPU_round (dest, 0, 0, control_w, sign);
tag = FPU_round (dest, 0, control_w, sign);
if ((dest->sigh & 0x80000000) == 0)
dest->exp--;
if ((dest->exp & 0x7FFF) == 0)
if (dest->exp != unrounded.exp || dest->sigh != unrounded.sigh || dest->sigl != unrounded.sigl)
EXCEPTION(EX_Underflow);
}
else tag = FPU_round (dest, 0, 0, control_w, sign);
else tag = FPU_round (dest, 0, control_w, sign);
return tag;
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_round.c |
| $Id: reg_round.c,v 1.7 2003-10-04 16:47:57 sshwarts Exp $
| $Id: reg_round.c,v 1.8 2003-10-05 12:26:11 sshwarts Exp $
| |
| Rounding/truncation/etc for FPU basic arithmetic functions. |
| |
@ -140,7 +140,7 @@ static int truncate_24(FPU_REG *x)
return LOST_DOWN;
}
int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
int FPU_round(FPU_REG *x, u32 extent, u16 control_w, u8 sign)
{
u64 work;
u32 leading;

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_u_add.c |
| $Id: reg_u_add.c,v 1.6 2003-10-04 16:47:57 sshwarts Exp $
| $Id: reg_u_add.c,v 1.7 2003-10-05 12:26:11 sshwarts Exp $
| |
| Add two valid (TAG_Valid) FPU_REG numbers, of the same sign, and put the |
| result in a destination FPU_REG. |
@ -141,5 +141,5 @@ int FPU_u_add(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *answ,
answ->exp ++;
}
return FPU_round(answ, extent, 0, control_w, sign);
return FPU_round(answ, extent, control_w, sign);
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_u_div.c |
| $Id: reg_u_div.c,v 1.6 2003-10-04 16:47:57 sshwarts Exp $
| $Id: reg_u_div.c,v 1.7 2003-10-05 12:26:11 sshwarts Exp $
| |
| Divide one FPU_REG by another and put the result in a destination FPU_REG.|
| |
@ -85,11 +85,10 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
dest->sigl = rat2;
dest->exp --;
return FPU_round(dest, rem, 0, control_w, sign);
return FPU_round(dest, rem, control_w, sign);
}
/* This may take a little time... */
accum64 = work64;
divr64 = significand(b);
@ -275,5 +274,5 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
dest->sigl = rat2;
dest->exp --;
return FPU_round(dest, rem, 0, control_w, sign);
return FPU_round(dest, rem, control_w, sign);
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_u_mul.c |
| $Id: reg_u_mul.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
| $Id: reg_u_mul.c,v 1.7 2003-10-05 12:26:11 sshwarts Exp $
| |
| Core multiplication routine |
| |
@ -96,5 +96,5 @@ int FPU_u_mul(const FPU_REG *a, const FPU_REG *b, FPU_REG *c, u16 cw,
c->sigl = mu;
c->sigh = mu >> 32;
return FPU_round(c, lh, 0, cw, sign);
return FPU_round(c, lh, cw, sign);
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| reg_u_sub.c |
| $Id: reg_u_sub.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
| $Id: reg_u_sub.c,v 1.7 2003-10-05 12:26:11 sshwarts Exp $
| |
| Core floating point subtraction routine. |
| |
@ -160,7 +160,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
dest->exp = answ.exp;
dest->sigh = answ.sigh;
dest->sigl = answ.sigl;
return FPU_round(dest, extent, 0, control_w, sign);
return FPU_round(dest, extent, control_w, sign);
}
if (answ.sigh == 0)
@ -194,7 +194,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
if (arg1->sigh == 0x80000000 && arg2->sigh == 0x80000000)
dest->exp++;
dest->exp -= EXTENDED_Ebias;
return FPU_round(dest, extent, 0, control_w, sign);
return FPU_round(dest, extent, control_w, sign);
}
else
{
@ -220,5 +220,5 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
dest->sigh = answ.sigh;
dest->sigl = answ.sigl;
return FPU_round(dest, extent, 0, control_w, sign);
return FPU_round(dest, extent, control_w, sign);
}

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------+
| wm_sqrt.c |
| $Id: wm_sqrt.c,v 1.4 2003-10-04 12:32:56 sshwarts Exp $
| $Id: wm_sqrt.c,v 1.5 2003-10-05 12:26:11 sshwarts Exp $
| |
| Fixed point arithmetic square root evaluation. |
| |
@ -35,7 +35,7 @@
#define ERR_MARGIN 0x20
int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
int wm_sqrt(FPU_REG *n, u16 control_w, u8 sign)
{
u64 nn, guess, halfn, lowr, mid, upr, diff, uwork;
s64 work;
@ -71,7 +71,6 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
guess32 = halfn / guess32 + (guess32 >> 1);
guess32 = halfn / guess32 + (guess32 >> 1);
/*
* Now that an estimate accurate to about 30 bits has been obtained,
* we improve it to 60 bits or so.
@ -94,7 +93,6 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
/* guess is now accurate to about 60 bits */
if ( work > 0 )
{
#ifdef PARANOID
@ -104,7 +102,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
}
#endif
/* We know the answer here. */
return FPU_round(n, 0x7fffffff, 0, control_w, sign);
return FPU_round(n, 0x7fffffff, control_w, sign);
}
/* Refine the guess to significantly more than 64 bits. */
@ -206,7 +204,6 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
/* The guess should now be good to about 90 bits */
}
setexponent16(n, 0);
if ( guess32 >= (u32) -ERR_MARGIN )
@ -220,7 +217,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
{
/* We have enough accuracy to decide rounding */
significand(n) = guess;
return FPU_round(n, guess32, 0, control_w, sign);
return FPU_round(n, guess32, control_w, sign);
}
if ( (guess32 <= ERR_MARGIN) || (guess32 >= (u32) -ERR_MARGIN) )
@ -264,31 +261,29 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
{
/* guess is too large */
significand(n) --;
return FPU_round(n, 0xffffff00, 0, control_w, sign);
return FPU_round(n, 0xffffff00, control_w, sign);
}
else if ( (s32)work32 < 0 )
{
/* guess is a little too small */
return FPU_round(n, 0x000000ff, 0, control_w, sign);
return FPU_round(n, 0x000000ff, control_w, sign);
}
else if ( (u32)lowr != 0 )
{
/* guess is too large */
significand(n) --;
return FPU_round(n, 0xffffff00, 0, control_w, sign);
return FPU_round(n, 0xffffff00, control_w, sign);
}
/* Our guess is precise. */
return FPU_round(n, 0, 0, control_w, sign);
return FPU_round(n, 0, control_w, sign);
}
/* Very similar to the case above, but the last bit is near 0.5.
We handle this just like the case above but we shift everything
by one bit. */
uwork = guess;
uwork <<= 1;
uwork |= 1; /* add the half bit */
@ -323,12 +318,12 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
if ( (s32)work32 < 0 )
{
/* guess plus half bit is a little too small */
return FPU_round(n, 0x800000ff, 0, control_w, sign);
return FPU_round(n, 0x800000ff, control_w, sign);
}
else /* Note that the lower 64 bits of the product are not all zero */
{
/* guess plus half bit is too large */
return FPU_round(n, 0x7fffff00, 0, control_w, sign);
return FPU_round(n, 0x7fffff00, control_w, sign);
}
/*
@ -338,4 +333,3 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
*/
}