Skip to content

Commit

Permalink
MIPS: math-emu: Get rid of typedefs.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed May 21, 2014
1 parent 2370881 commit 2209bcb
Show file tree
Hide file tree
Showing 40 changed files with 212 additions and 212 deletions.
66 changes: 33 additions & 33 deletions arch/mips/math-emu/cp1emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,8 @@ static const unsigned char cmptab[8] = {
*/

#define DEF3OP(name, p, f1, f2, f3) \
static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \
ieee754##p t) \
static union ieee754##p fpemu_##p##_##name(union ieee754##p r, union ieee754##p s, \
union ieee754##p t) \
{ \
struct _ieee754_csr ieee754_csr_save; \
s = f1(s, t); \
Expand All @@ -1364,22 +1364,22 @@ static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \
return s; \
}

static ieee754dp fpemu_dp_recip(ieee754dp d)
static union ieee754dp fpemu_dp_recip(union ieee754dp d)
{
return ieee754dp_div(ieee754dp_one(0), d);
}

static ieee754dp fpemu_dp_rsqrt(ieee754dp d)
static union ieee754dp fpemu_dp_rsqrt(union ieee754dp d)
{
return ieee754dp_div(ieee754dp_one(0), ieee754dp_sqrt(d));
}

static ieee754sp fpemu_sp_recip(ieee754sp s)
static union ieee754sp fpemu_sp_recip(union ieee754sp s)
{
return ieee754sp_div(ieee754sp_one(0), s);
}

static ieee754sp fpemu_sp_rsqrt(ieee754sp s)
static union ieee754sp fpemu_sp_rsqrt(union ieee754sp s)
{
return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s));
}
Expand All @@ -1403,8 +1403,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
switch (MIPSInst_FMA_FFMT(ir)) {
case s_fmt:{ /* 0 */

ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp);
ieee754sp fd, fr, fs, ft;
union ieee754sp(*handler) (union ieee754sp, union ieee754sp, union ieee754sp);
union ieee754sp fd, fr, fs, ft;
u32 __user *va;
u32 val;

Expand Down Expand Up @@ -1492,8 +1492,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
}

case d_fmt:{ /* 1 */
ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp);
ieee754dp fd, fr, fs, ft;
union ieee754dp(*handler) (union ieee754dp, union ieee754dp, union ieee754dp);
union ieee754dp fd, fr, fs, ft;
u64 __user *va;
u64 val;

Expand Down Expand Up @@ -1588,8 +1588,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
unsigned rcsr = 0; /* resulting csr */
unsigned cond;
union {
ieee754dp d;
ieee754sp s;
union ieee754dp d;
union ieee754sp s;
int w;
#ifdef __mips64
s64 l;
Expand All @@ -1600,8 +1600,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
case s_fmt:{ /* 0 */
union {
ieee754sp(*b) (ieee754sp, ieee754sp);
ieee754sp(*u) (ieee754sp);
union ieee754sp(*b) (union ieee754sp, union ieee754sp);
union ieee754sp(*u) (union ieee754sp);
} handler;

switch (MIPSInst_FUNC(ir)) {
Expand Down Expand Up @@ -1666,7 +1666,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
/* binary op on handler */
scopbop:
{
ieee754sp fs, ft;
union ieee754sp fs, ft;

SPFROMREG(fs, MIPSInst_FS(ir));
SPFROMREG(ft, MIPSInst_FT(ir));
Expand All @@ -1676,7 +1676,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
}
scopuop:
{
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
rv.s = (*handler.u) (fs);
Expand All @@ -1699,15 +1699,15 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fcvts_op:
return SIGILL; /* not defined */
case fcvtd_op:{
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
rv.d = ieee754dp_fsp(fs);
rfmt = d_fmt;
goto copcsr;
}
case fcvtw_op:{
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
rv.w = ieee754sp_tint(fs);
Expand All @@ -1721,7 +1721,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceil_op:
case ffloor_op:{
unsigned int oldrm = ieee754_csr.rm;
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
Expand All @@ -1734,7 +1734,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,

#if defined(__mips64)
case fcvtl_op:{
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
rv.l = ieee754sp_tlong(fs);
Expand All @@ -1747,7 +1747,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceill_op:
case ffloorl_op:{
unsigned int oldrm = ieee754_csr.rm;
ieee754sp fs;
union ieee754sp fs;

SPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
Expand All @@ -1761,7 +1761,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
default:
if (MIPSInst_FUNC(ir) >= fcmp_op) {
unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
ieee754sp fs, ft;
union ieee754sp fs, ft;

SPFROMREG(fs, MIPSInst_FS(ir));
SPFROMREG(ft, MIPSInst_FT(ir));
Expand All @@ -1785,8 +1785,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,

case d_fmt:{
union {
ieee754dp(*b) (ieee754dp, ieee754dp);
ieee754dp(*u) (ieee754dp);
union ieee754dp(*b) (union ieee754dp, union ieee754dp);
union ieee754dp(*u) (union ieee754dp);
} handler;

switch (MIPSInst_FUNC(ir)) {
Expand Down Expand Up @@ -1852,7 +1852,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,

/* binary op on handler */
dcopbop:{
ieee754dp fs, ft;
union ieee754dp fs, ft;

DPFROMREG(fs, MIPSInst_FS(ir));
DPFROMREG(ft, MIPSInst_FT(ir));
Expand All @@ -1861,7 +1861,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
goto copcsr;
}
dcopuop:{
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
rv.d = (*handler.u) (fs);
Expand All @@ -1870,7 +1870,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,

/* unary conv ops */
case fcvts_op:{
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
rv.s = ieee754sp_fdp(fs);
Expand All @@ -1881,7 +1881,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
return SIGILL; /* not defined */

case fcvtw_op:{
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
rv.w = ieee754dp_tint(fs); /* wrong */
Expand All @@ -1895,7 +1895,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceil_op:
case ffloor_op:{
unsigned int oldrm = ieee754_csr.rm;
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
Expand All @@ -1908,7 +1908,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,

#if defined(__mips64)
case fcvtl_op:{
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
rv.l = ieee754dp_tlong(fs);
Expand All @@ -1921,7 +1921,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceill_op:
case ffloorl_op:{
unsigned int oldrm = ieee754_csr.rm;
ieee754dp fs;
union ieee754dp fs;

DPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
Expand All @@ -1935,7 +1935,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
default:
if (MIPSInst_FUNC(ir) >= fcmp_op) {
unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
ieee754dp fs, ft;
union ieee754dp fs, ft;

DPFROMREG(fs, MIPSInst_FS(ir));
DPFROMREG(ft, MIPSInst_FT(ir));
Expand All @@ -1960,7 +1960,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
}

case w_fmt:{
ieee754sp fs;
union ieee754sp fs;

switch (MIPSInst_FUNC(ir)) {
case fcvts_op:
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y)
union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
{
COMPXDP;
COMPYDP;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

int ieee754dp_cmp(ieee754dp x, ieee754dp y, int cmp, int sig)
int ieee754dp_cmp(union ieee754dp x, union ieee754dp y, int cmp, int sig)
{
COMPXDP;
COMPYDP;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y)
union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
{
COMPXDP;
COMPYDP;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/math-emu/dp_fint.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_fint(int x)
union ieee754dp ieee754dp_fint(int x)
{
u64 xm;
int xe;
Expand Down Expand Up @@ -70,7 +70,7 @@ ieee754dp ieee754dp_fint(int x)
#endif
}

ieee754dp ieee754dp_funs(unsigned int u)
union ieee754dp ieee754dp_funs(unsigned int u)
{
if ((int) u < 0)
return ieee754dp_add(ieee754dp_1e31(),
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/math-emu/dp_flong.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_flong(s64 x)
union ieee754dp ieee754dp_flong(s64 x)
{
u64 xm;
int xe;
Expand Down Expand Up @@ -68,7 +68,7 @@ ieee754dp ieee754dp_flong(s64 x)
DPNORMRET1(xs, xe, xm, "dp_flong", x);
}

ieee754dp ieee754dp_fulong(u64 u)
union ieee754dp ieee754dp_fulong(u64 u)
{
if ((s64) u < 0)
return ieee754dp_add(ieee754dp_1e63(),
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_frexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/* close to ieeep754dp_logb
*/
ieee754dp ieee754dp_frexp(ieee754dp x, int *eptr)
union ieee754dp ieee754dp_frexp(union ieee754dp x, int *eptr)
{
COMPXDP;
CLEARCX;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_fsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_fsp(ieee754sp x)
union ieee754dp ieee754dp_fsp(union ieee754sp x)
{
COMPXSP;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_logb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_logb(ieee754dp x)
union ieee754dp ieee754dp_logb(union ieee754dp x)
{
COMPXDP;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_modf.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/* modf function is always exact for a finite number
*/
ieee754dp ieee754dp_modf(ieee754dp x, ieee754dp *ip)
union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp *ip)
{
COMPXDP;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/dp_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y)
union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
{
COMPXDP;
COMPYDP;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/math-emu/dp_scalb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "ieee754dp.h"

ieee754dp ieee754dp_scalb(ieee754dp x, int n)
union ieee754dp ieee754dp_scalb(union ieee754dp x, int n)
{
COMPXDP;

Expand All @@ -51,7 +51,7 @@ ieee754dp ieee754dp_scalb(ieee754dp x, int n)
}


ieee754dp ieee754dp_ldexp(ieee754dp x, int n)
union ieee754dp ieee754dp_ldexp(union ieee754dp x, int n)
{
return ieee754dp_scalb(x, n);
}
Loading

0 comments on commit 2209bcb

Please sign in to comment.