Commit 2209bcb1 authored by Ralf Baechle's avatar Ralf Baechle

MIPS: math-emu: Get rid of typedefs.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 23708818
...@@ -1349,8 +1349,8 @@ static const unsigned char cmptab[8] = { ...@@ -1349,8 +1349,8 @@ static const unsigned char cmptab[8] = {
*/ */
#define DEF3OP(name, p, f1, f2, f3) \ #define DEF3OP(name, p, f1, f2, f3) \
static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \ static union ieee754##p fpemu_##p##_##name(union ieee754##p r, union ieee754##p s, \
ieee754##p t) \ union ieee754##p t) \
{ \ { \
struct _ieee754_csr ieee754_csr_save; \ struct _ieee754_csr ieee754_csr_save; \
s = f1(s, t); \ s = f1(s, t); \
...@@ -1364,22 +1364,22 @@ static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \ ...@@ -1364,22 +1364,22 @@ static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \
return 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); 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)); 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); 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)); return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s));
} }
...@@ -1403,8 +1403,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1403,8 +1403,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
switch (MIPSInst_FMA_FFMT(ir)) { switch (MIPSInst_FMA_FFMT(ir)) {
case s_fmt:{ /* 0 */ case s_fmt:{ /* 0 */
ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp); union ieee754sp(*handler) (union ieee754sp, union ieee754sp, union ieee754sp);
ieee754sp fd, fr, fs, ft; union ieee754sp fd, fr, fs, ft;
u32 __user *va; u32 __user *va;
u32 val; u32 val;
...@@ -1492,8 +1492,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1492,8 +1492,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
} }
case d_fmt:{ /* 1 */ case d_fmt:{ /* 1 */
ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp); union ieee754dp(*handler) (union ieee754dp, union ieee754dp, union ieee754dp);
ieee754dp fd, fr, fs, ft; union ieee754dp fd, fr, fs, ft;
u64 __user *va; u64 __user *va;
u64 val; u64 val;
...@@ -1588,8 +1588,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1588,8 +1588,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
unsigned rcsr = 0; /* resulting csr */ unsigned rcsr = 0; /* resulting csr */
unsigned cond; unsigned cond;
union { union {
ieee754dp d; union ieee754dp d;
ieee754sp s; union ieee754sp s;
int w; int w;
#ifdef __mips64 #ifdef __mips64
s64 l; s64 l;
...@@ -1600,8 +1600,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1600,8 +1600,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) { switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
case s_fmt:{ /* 0 */ case s_fmt:{ /* 0 */
union { union {
ieee754sp(*b) (ieee754sp, ieee754sp); union ieee754sp(*b) (union ieee754sp, union ieee754sp);
ieee754sp(*u) (ieee754sp); union ieee754sp(*u) (union ieee754sp);
} handler; } handler;
switch (MIPSInst_FUNC(ir)) { switch (MIPSInst_FUNC(ir)) {
...@@ -1666,7 +1666,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1666,7 +1666,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
/* binary op on handler */ /* binary op on handler */
scopbop: scopbop:
{ {
ieee754sp fs, ft; union ieee754sp fs, ft;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
SPFROMREG(ft, MIPSInst_FT(ir)); SPFROMREG(ft, MIPSInst_FT(ir));
...@@ -1676,7 +1676,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1676,7 +1676,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
} }
scopuop: scopuop:
{ {
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
rv.s = (*handler.u) (fs); rv.s = (*handler.u) (fs);
...@@ -1699,7 +1699,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1699,7 +1699,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fcvts_op: case fcvts_op:
return SIGILL; /* not defined */ return SIGILL; /* not defined */
case fcvtd_op:{ case fcvtd_op:{
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
rv.d = ieee754dp_fsp(fs); rv.d = ieee754dp_fsp(fs);
...@@ -1707,7 +1707,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1707,7 +1707,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
goto copcsr; goto copcsr;
} }
case fcvtw_op:{ case fcvtw_op:{
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
rv.w = ieee754sp_tint(fs); rv.w = ieee754sp_tint(fs);
...@@ -1721,7 +1721,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1721,7 +1721,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceil_op: case fceil_op:
case ffloor_op:{ case ffloor_op:{
unsigned int oldrm = ieee754_csr.rm; unsigned int oldrm = ieee754_csr.rm;
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
...@@ -1734,7 +1734,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1734,7 +1734,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
#if defined(__mips64) #if defined(__mips64)
case fcvtl_op:{ case fcvtl_op:{
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
rv.l = ieee754sp_tlong(fs); rv.l = ieee754sp_tlong(fs);
...@@ -1747,7 +1747,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1747,7 +1747,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceill_op: case fceill_op:
case ffloorl_op:{ case ffloorl_op:{
unsigned int oldrm = ieee754_csr.rm; unsigned int oldrm = ieee754_csr.rm;
ieee754sp fs; union ieee754sp fs;
SPFROMREG(fs, MIPSInst_FS(ir)); SPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
...@@ -1761,7 +1761,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1761,7 +1761,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
default: default:
if (MIPSInst_FUNC(ir) >= fcmp_op) { if (MIPSInst_FUNC(ir) >= fcmp_op) {
unsigned cmpop = 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(fs, MIPSInst_FS(ir));
SPFROMREG(ft, MIPSInst_FT(ir)); SPFROMREG(ft, MIPSInst_FT(ir));
...@@ -1785,8 +1785,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1785,8 +1785,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case d_fmt:{ case d_fmt:{
union { union {
ieee754dp(*b) (ieee754dp, ieee754dp); union ieee754dp(*b) (union ieee754dp, union ieee754dp);
ieee754dp(*u) (ieee754dp); union ieee754dp(*u) (union ieee754dp);
} handler; } handler;
switch (MIPSInst_FUNC(ir)) { switch (MIPSInst_FUNC(ir)) {
...@@ -1852,7 +1852,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1852,7 +1852,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
/* binary op on handler */ /* binary op on handler */
dcopbop:{ dcopbop:{
ieee754dp fs, ft; union ieee754dp fs, ft;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
DPFROMREG(ft, MIPSInst_FT(ir)); DPFROMREG(ft, MIPSInst_FT(ir));
...@@ -1861,7 +1861,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1861,7 +1861,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
goto copcsr; goto copcsr;
} }
dcopuop:{ dcopuop:{
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
rv.d = (*handler.u) (fs); rv.d = (*handler.u) (fs);
...@@ -1870,7 +1870,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1870,7 +1870,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
/* unary conv ops */ /* unary conv ops */
case fcvts_op:{ case fcvts_op:{
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
rv.s = ieee754sp_fdp(fs); rv.s = ieee754sp_fdp(fs);
...@@ -1881,7 +1881,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1881,7 +1881,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
return SIGILL; /* not defined */ return SIGILL; /* not defined */
case fcvtw_op:{ case fcvtw_op:{
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
rv.w = ieee754dp_tint(fs); /* wrong */ rv.w = ieee754dp_tint(fs); /* wrong */
...@@ -1895,7 +1895,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1895,7 +1895,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceil_op: case fceil_op:
case ffloor_op:{ case ffloor_op:{
unsigned int oldrm = ieee754_csr.rm; unsigned int oldrm = ieee754_csr.rm;
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
...@@ -1908,7 +1908,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1908,7 +1908,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
#if defined(__mips64) #if defined(__mips64)
case fcvtl_op:{ case fcvtl_op:{
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
rv.l = ieee754dp_tlong(fs); rv.l = ieee754dp_tlong(fs);
...@@ -1921,7 +1921,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1921,7 +1921,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case fceill_op: case fceill_op:
case ffloorl_op:{ case ffloorl_op:{
unsigned int oldrm = ieee754_csr.rm; unsigned int oldrm = ieee754_csr.rm;
ieee754dp fs; union ieee754dp fs;
DPFROMREG(fs, MIPSInst_FS(ir)); DPFROMREG(fs, MIPSInst_FS(ir));
ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))];
...@@ -1935,7 +1935,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1935,7 +1935,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
default: default:
if (MIPSInst_FUNC(ir) >= fcmp_op) { if (MIPSInst_FUNC(ir) >= fcmp_op) {
unsigned cmpop = 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(fs, MIPSInst_FS(ir));
DPFROMREG(ft, MIPSInst_FT(ir)); DPFROMREG(ft, MIPSInst_FT(ir));
...@@ -1960,7 +1960,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1960,7 +1960,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
} }
case w_fmt:{ case w_fmt:{
ieee754sp fs; union ieee754sp fs;
switch (MIPSInst_FUNC(ir)) { switch (MIPSInst_FUNC(ir)) {
case fcvts_op: case fcvts_op:
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
{ {
COMPXDP; COMPXDP;
COMPYDP; COMPYDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #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; COMPXDP;
COMPYDP; COMPYDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
{ {
COMPXDP; COMPXDP;
COMPYDP; COMPYDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_fint(int x) union ieee754dp ieee754dp_fint(int x)
{ {
u64 xm; u64 xm;
int xe; int xe;
...@@ -70,7 +70,7 @@ ieee754dp ieee754dp_fint(int x) ...@@ -70,7 +70,7 @@ ieee754dp ieee754dp_fint(int x)
#endif #endif
} }
ieee754dp ieee754dp_funs(unsigned int u) union ieee754dp ieee754dp_funs(unsigned int u)
{ {
if ((int) u < 0) if ((int) u < 0)
return ieee754dp_add(ieee754dp_1e31(), return ieee754dp_add(ieee754dp_1e31(),
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_flong(s64 x) union ieee754dp ieee754dp_flong(s64 x)
{ {
u64 xm; u64 xm;
int xe; int xe;
...@@ -68,7 +68,7 @@ ieee754dp ieee754dp_flong(s64 x) ...@@ -68,7 +68,7 @@ ieee754dp ieee754dp_flong(s64 x)
DPNORMRET1(xs, xe, xm, "dp_flong", x); DPNORMRET1(xs, xe, xm, "dp_flong", x);
} }
ieee754dp ieee754dp_fulong(u64 u) union ieee754dp ieee754dp_fulong(u64 u)
{ {
if ((s64) u < 0) if ((s64) u < 0)
return ieee754dp_add(ieee754dp_1e63(), return ieee754dp_add(ieee754dp_1e63(),
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* close to ieeep754dp_logb /* close to ieeep754dp_logb
*/ */
ieee754dp ieee754dp_frexp(ieee754dp x, int *eptr) union ieee754dp ieee754dp_frexp(union ieee754dp x, int *eptr)
{ {
COMPXDP; COMPXDP;
CLEARCX; CLEARCX;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_fsp(ieee754sp x) union ieee754dp ieee754dp_fsp(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_logb(ieee754dp x) union ieee754dp ieee754dp_logb(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* modf function is always exact for a finite number /* 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; COMPXDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
{ {
COMPXDP; COMPXDP;
COMPYDP; COMPYDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_scalb(ieee754dp x, int n) union ieee754dp ieee754dp_scalb(union ieee754dp x, int n)
{ {
COMPXDP; COMPXDP;
...@@ -51,7 +51,7 @@ ieee754dp ieee754dp_scalb(ieee754dp x, int n) ...@@ -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); return ieee754dp_scalb(x, n);
} }
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
#include "ieee754dp.h" #include "ieee754dp.h"
int ieee754dp_finite(ieee754dp x) int ieee754dp_finite(union ieee754dp x)
{ {
return DPBEXP(x) != DP_EMAX + 1 + DP_EBIAS; return DPBEXP(x) != DP_EMAX + 1 + DP_EBIAS;
} }
ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_copysign(union ieee754dp x, union ieee754dp y)
{ {
CLEARCX; CLEARCX;
DPSIGN(x) = DPSIGN(y); DPSIGN(x) = DPSIGN(y);
...@@ -39,7 +39,7 @@ ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y) ...@@ -39,7 +39,7 @@ ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y)
} }
ieee754dp ieee754dp_neg(ieee754dp x) union ieee754dp ieee754dp_neg(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
...@@ -55,7 +55,7 @@ ieee754dp ieee754dp_neg(ieee754dp x) ...@@ -55,7 +55,7 @@ ieee754dp ieee754dp_neg(ieee754dp x)
DPSIGN(x) ^= 1; DPSIGN(x) ^= 1;
if (xc == IEEE754_CLASS_SNAN) { if (xc == IEEE754_CLASS_SNAN) {
ieee754dp y = ieee754dp_indef(); union ieee754dp y = ieee754dp_indef();
SETCX(IEEE754_INVALID_OPERATION); SETCX(IEEE754_INVALID_OPERATION);
DPSIGN(y) = DPSIGN(x); DPSIGN(y) = DPSIGN(x);
return ieee754dp_nanxcpt(y, "neg"); return ieee754dp_nanxcpt(y, "neg");
...@@ -65,7 +65,7 @@ ieee754dp ieee754dp_neg(ieee754dp x) ...@@ -65,7 +65,7 @@ ieee754dp ieee754dp_neg(ieee754dp x)
} }
ieee754dp ieee754dp_abs(ieee754dp x) union ieee754dp ieee754dp_abs(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
......
...@@ -34,10 +34,10 @@ static const unsigned table[] = { ...@@ -34,10 +34,10 @@ static const unsigned table[] = {
1742, 661, 130 1742, 661, 130
}; };
ieee754dp ieee754dp_sqrt(ieee754dp x) union ieee754dp ieee754dp_sqrt(union ieee754dp x)
{ {
struct _ieee754_csr oldcsr; struct _ieee754_csr oldcsr;
ieee754dp y, z, t; union ieee754dp y, z, t;
unsigned scalx, yh; unsigned scalx, yh;
COMPXDP; COMPXDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
{ {
COMPXDP; COMPXDP;
COMPYDP; COMPYDP;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include "ieee754dp.h" #include "ieee754dp.h"
int ieee754dp_tint(ieee754dp x) int ieee754dp_tint(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
...@@ -109,9 +109,9 @@ int ieee754dp_tint(ieee754dp x) ...@@ -109,9 +109,9 @@ int ieee754dp_tint(ieee754dp x)
} }
unsigned int ieee754dp_tuns(ieee754dp x) unsigned int ieee754dp_tuns(union ieee754dp x)
{ {
ieee754dp hb = ieee754dp_1e31(); union ieee754dp hb = ieee754dp_1e31();
/* what if x < 0 ?? */ /* what if x < 0 ?? */
if (ieee754dp_lt(x, hb)) if (ieee754dp_lt(x, hb))
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754dp.h" #include "ieee754dp.h"
s64 ieee754dp_tlong(ieee754dp x) s64 ieee754dp_tlong(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
...@@ -112,9 +112,9 @@ s64 ieee754dp_tlong(ieee754dp x) ...@@ -112,9 +112,9 @@ s64 ieee754dp_tlong(ieee754dp x)
} }
u64 ieee754dp_tulong(ieee754dp x) u64 ieee754dp_tulong(union ieee754dp x)
{ {
ieee754dp hb = ieee754dp_1e63(); union ieee754dp hb = ieee754dp_1e63();
/* what if x < 0 ?? */ /* what if x < 0 ?? */
if (ieee754dp_lt(x, hb)) if (ieee754dp_lt(x, hb))
......
This diff is collapsed.
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#define DPBEXP(dp) (dp.parts.bexp) #define DPBEXP(dp) (dp.parts.bexp)
#define DPMANT(dp) (dp.parts.mant) #define DPMANT(dp) (dp.parts.mant)
ieee754dp ieee754dp_dump(char *m, ieee754dp x) union ieee754dp ieee754dp_dump(char *m, union ieee754dp x)
{ {
int i; int i;
...@@ -96,7 +96,7 @@ ieee754dp ieee754dp_dump(char *m, ieee754dp x) ...@@ -96,7 +96,7 @@ ieee754dp ieee754dp_dump(char *m, ieee754dp x)
return x; return x;
} }
ieee754sp ieee754sp_dump(char *m, ieee754sp x) union ieee754sp ieee754sp_dump(char *m, union ieee754sp x)
{ {
int i; int i;
......
...@@ -27,26 +27,26 @@ ...@@ -27,26 +27,26 @@
#include "ieee754dp.h" #include "ieee754dp.h"
int ieee754dp_class(ieee754dp x) int ieee754dp_class(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
EXPLODEXDP; EXPLODEXDP;
return xc; return xc;
} }
int ieee754dp_isnan(ieee754dp x) int ieee754dp_isnan(union ieee754dp x)
{ {
return ieee754dp_class(x) >= IEEE754_CLASS_SNAN; return ieee754dp_class(x) >= IEEE754_CLASS_SNAN;
} }
int ieee754dp_issnan(ieee754dp x) int ieee754dp_issnan(union ieee754dp x)
{ {
assert(ieee754dp_isnan(x)); assert(ieee754dp_isnan(x));
return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1)); return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1));
} }
ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...) union ieee754dp __cold ieee754dp_xcpt(union ieee754dp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
if (!TSTX()) if (!TSTX())
...@@ -61,7 +61,7 @@ ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...) ...@@ -61,7 +61,7 @@ ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...)
return ax.rv.dp; return ax.rv.dp;
} }
ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
...@@ -88,7 +88,7 @@ ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) ...@@ -88,7 +88,7 @@ ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
return ax.rv.dp; return ax.rv.dp;
} }
ieee754dp ieee754dp_bestnan(ieee754dp x, ieee754dp y) union ieee754dp ieee754dp_bestnan(union ieee754dp x, union ieee754dp y)
{ {
assert(ieee754dp_isnan(x)); assert(ieee754dp_isnan(x));
assert(ieee754dp_isnan(y)); assert(ieee754dp_isnan(y));
...@@ -131,7 +131,7 @@ static u64 get_rounding(int sn, u64 xm) ...@@ -131,7 +131,7 @@ static u64 get_rounding(int sn, u64 xm)
* xe is an unbiased exponent * xe is an unbiased exponent
* xm is 3bit extended precision value. * xm is 3bit extended precision value.
*/ */
ieee754dp ieee754dp_format(int sn, int xe, u64 xm) union ieee754dp ieee754dp_format(int sn, int xe, u64 xm)
{ {
assert(xm); /* we don't gen exact zeros (probably should) */ assert(xm); /* we don't gen exact zeros (probably should) */
......
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
#define DPDNORMX DPDNORMx(xm, xe) #define DPDNORMX DPDNORMx(xm, xe)
#define DPDNORMY DPDNORMx(ym, ye) #define DPDNORMY DPDNORMx(ym, ye)
static inline ieee754dp builddp(int s, int bx, u64 m) static inline union ieee754dp builddp(int s, int bx, u64 m)
{ {
ieee754dp r; union ieee754dp r;
assert((s) == 0 || (s) == 1); assert((s) == 0 || (s) == 1);
assert((bx) >= DP_EMIN - 1 + DP_EBIAS assert((bx) >= DP_EMIN - 1 + DP_EBIAS
...@@ -61,19 +61,19 @@ static inline ieee754dp builddp(int s, int bx, u64 m) ...@@ -61,19 +61,19 @@ static inline ieee754dp builddp(int s, int bx, u64 m)
return r; return r;
} }
extern int ieee754dp_isnan(ieee754dp); extern int ieee754dp_isnan(union ieee754dp);
extern int ieee754dp_issnan(ieee754dp); extern int ieee754dp_issnan(union ieee754dp);
extern int __cold ieee754si_xcpt(int, const char *, ...); extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 __cold ieee754di_xcpt(s64, const char *, ...); extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern ieee754dp __cold ieee754dp_xcpt(ieee754dp, const char *, ...); extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...);
extern ieee754dp __cold ieee754dp_nanxcpt(ieee754dp, const char *, ...); extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp, const char *, ...);
extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp); extern union ieee754dp ieee754dp_bestnan(union ieee754dp, union ieee754dp);
extern ieee754dp ieee754dp_format(int, int, u64); extern union ieee754dp ieee754dp_format(int, int, u64);
#define DPNORMRET2(s, e, m, name, a0, a1) \ #define DPNORMRET2(s, e, m, name, a0, a1) \
{ \ { \
ieee754dp V = ieee754dp_format(s, e, m); \ union ieee754dp V = ieee754dp_format(s, e, m); \
if(TSTX()) \ if(TSTX()) \
return ieee754dp_xcpt(V, name, a0, a1); \ return ieee754dp_xcpt(V, name, a0, a1); \
else \ else \
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include "ieee754.h" #include "ieee754.h"
ieee754dp ieee754dp_floor(ieee754dp x) union ieee754dp ieee754dp_floor(union ieee754dp x)
{ {
ieee754dp i; union ieee754dp i;
if (ieee754dp_lt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) if (ieee754dp_lt(ieee754dp_modf(x, &i), ieee754dp_zero(0)))
return ieee754dp_sub(i, ieee754dp_one(0)); return ieee754dp_sub(i, ieee754dp_one(0));
...@@ -36,9 +36,9 @@ ieee754dp ieee754dp_floor(ieee754dp x) ...@@ -36,9 +36,9 @@ ieee754dp ieee754dp_floor(ieee754dp x)
return i; return i;
} }
ieee754dp ieee754dp_ceil(ieee754dp x) union ieee754dp ieee754dp_ceil(union ieee754dp x)
{ {
ieee754dp i; union ieee754dp i;
if (ieee754dp_gt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) if (ieee754dp_gt(ieee754dp_modf(x, &i), ieee754dp_zero(0)))
return ieee754dp_add(i, ieee754dp_one(0)); return ieee754dp_add(i, ieee754dp_one(0));
...@@ -46,9 +46,9 @@ ieee754dp ieee754dp_ceil(ieee754dp x) ...@@ -46,9 +46,9 @@ ieee754dp ieee754dp_ceil(ieee754dp x)
return i; return i;
} }
ieee754dp ieee754dp_trunc(ieee754dp x) union ieee754dp ieee754dp_trunc(union ieee754dp x)
{ {
ieee754dp i; union ieee754dp i;
(void) ieee754dp_modf(x, &i); (void) ieee754dp_modf(x, &i);
return i; return i;
......
...@@ -27,26 +27,26 @@ ...@@ -27,26 +27,26 @@
#include "ieee754sp.h" #include "ieee754sp.h"
int ieee754sp_class(ieee754sp x) int ieee754sp_class(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
EXPLODEXSP; EXPLODEXSP;
return xc; return xc;
} }
int ieee754sp_isnan(ieee754sp x) int ieee754sp_isnan(union ieee754sp x)
{ {
return ieee754sp_class(x) >= IEEE754_CLASS_SNAN; return ieee754sp_class(x) >= IEEE754_CLASS_SNAN;
} }
int ieee754sp_issnan(ieee754sp x) int ieee754sp_issnan(union ieee754sp x)
{ {
assert(ieee754sp_isnan(x)); assert(ieee754sp_isnan(x));
return (SPMANT(x) & SP_MBIT(SP_MBITS-1)); return (SPMANT(x) & SP_MBIT(SP_MBITS-1));
} }
ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...) union ieee754sp __cold ieee754sp_xcpt(union ieee754sp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
...@@ -62,7 +62,7 @@ ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...) ...@@ -62,7 +62,7 @@ ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...)
return ax.rv.sp; return ax.rv.sp;
} }
ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
...@@ -89,7 +89,7 @@ ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) ...@@ -89,7 +89,7 @@ ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...)
return ax.rv.sp; return ax.rv.sp;
} }
ieee754sp ieee754sp_bestnan(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_bestnan(union ieee754sp x, union ieee754sp y)
{ {
assert(ieee754sp_isnan(x)); assert(ieee754sp_isnan(x));
assert(ieee754sp_isnan(y)); assert(ieee754sp_isnan(y));
...@@ -132,7 +132,7 @@ static unsigned get_rounding(int sn, unsigned xm) ...@@ -132,7 +132,7 @@ static unsigned get_rounding(int sn, unsigned xm)
* xe is an unbiased exponent * xe is an unbiased exponent
* xm is 3bit extended precision value. * xm is 3bit extended precision value.
*/ */
ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
{ {
assert(xm); /* we don't gen exact zeros (probably should) */ assert(xm); /* we don't gen exact zeros (probably should) */
......
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
#define SPDNORMX SPDNORMx(xm, xe) #define SPDNORMX SPDNORMx(xm, xe)
#define SPDNORMY SPDNORMx(ym, ye) #define SPDNORMY SPDNORMx(ym, ye)
static inline ieee754sp buildsp(int s, int bx, unsigned m) static inline union ieee754sp buildsp(int s, int bx, unsigned m)
{ {
ieee754sp r; union ieee754sp r;
assert((s) == 0 || (s) == 1); assert((s) == 0 || (s) == 1);
assert((bx) >= SP_EMIN - 1 + SP_EBIAS assert((bx) >= SP_EMIN - 1 + SP_EBIAS
...@@ -67,19 +67,19 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m) ...@@ -67,19 +67,19 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m)
return r; return r;
} }
extern int ieee754sp_isnan(ieee754sp); extern int ieee754sp_isnan(union ieee754sp);
extern int ieee754sp_issnan(ieee754sp); extern int ieee754sp_issnan(union ieee754sp);
extern int __cold ieee754si_xcpt(int, const char *, ...); extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 __cold ieee754di_xcpt(s64, const char *, ...); extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern ieee754sp __cold ieee754sp_xcpt(ieee754sp, const char *, ...); extern union ieee754sp __cold ieee754sp_xcpt(union ieee754sp, const char *, ...);
extern ieee754sp __cold ieee754sp_nanxcpt(ieee754sp, const char *, ...); extern union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp, const char *, ...);
extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp); extern union ieee754sp ieee754sp_bestnan(union ieee754sp, union ieee754sp);
extern ieee754sp ieee754sp_format(int, int, unsigned); extern union ieee754sp ieee754sp_format(int, int, unsigned);
#define SPNORMRET2(s, e, m, name, a0, a1) \ #define SPNORMRET2(s, e, m, name, a0, a1) \
{ \ { \
ieee754sp V = ieee754sp_format(s, e, m); \ union ieee754sp V = ieee754sp_format(s, e, m); \
if(TSTX()) \ if(TSTX()) \
return ieee754sp_xcpt(V, name, a0, a1); \ return ieee754sp_xcpt(V, name, a0, a1); \
else \ else \
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
{ {
COMPXSP; COMPXSP;
COMPYSP; COMPYSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
int ieee754sp_cmp(ieee754sp x, ieee754sp y, int cmp, int sig) int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cmp, int sig)
{ {
COMPXSP; COMPXSP;
COMPYSP; COMPYSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
{ {
COMPXSP; COMPXSP;
COMPYSP; COMPYSP;
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_fdp(ieee754dp x) union ieee754sp ieee754sp_fdp(union ieee754dp x)
{ {
COMPXDP; COMPXDP;
ieee754sp nan; union ieee754sp nan;
EXPLODEXDP; EXPLODEXDP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_fint(int x) union ieee754sp ieee754sp_fint(int x)
{ {
unsigned xm; unsigned xm;
int xe; int xe;
...@@ -70,7 +70,7 @@ ieee754sp ieee754sp_fint(int x) ...@@ -70,7 +70,7 @@ ieee754sp ieee754sp_fint(int x)
} }
ieee754sp ieee754sp_funs(unsigned int u) union ieee754sp ieee754sp_funs(unsigned int u)
{ {
if ((int) u < 0) if ((int) u < 0)
return ieee754sp_add(ieee754sp_1e31(), return ieee754sp_add(ieee754sp_1e31(),
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_flong(s64 x) union ieee754sp ieee754sp_flong(s64 x)
{ {
u64 xm; /* <--- need 64-bit mantissa temp */ u64 xm; /* <--- need 64-bit mantissa temp */
int xe; int xe;
...@@ -69,7 +69,7 @@ ieee754sp ieee754sp_flong(s64 x) ...@@ -69,7 +69,7 @@ ieee754sp ieee754sp_flong(s64 x)
} }
ieee754sp ieee754sp_fulong(u64 u) union ieee754sp ieee754sp_fulong(u64 u)
{ {
if ((s64) u < 0) if ((s64) u < 0)
return ieee754sp_add(ieee754sp_1e63(), return ieee754sp_add(ieee754sp_1e63(),
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* close to ieeep754sp_logb /* close to ieeep754sp_logb
*/ */
ieee754sp ieee754sp_frexp(ieee754sp x, int *eptr) union ieee754sp ieee754sp_frexp(union ieee754sp x, int *eptr)
{ {
COMPXSP; COMPXSP;
CLEARCX; CLEARCX;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_logb(ieee754sp x) union ieee754sp ieee754sp_logb(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* modf function is always exact for a finite number /* modf function is always exact for a finite number
*/ */
ieee754sp ieee754sp_modf(ieee754sp x, ieee754sp *ip) union ieee754sp ieee754sp_modf(union ieee754sp x, union ieee754sp *ip)
{ {
COMPXSP; COMPXSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_mul(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
{ {
COMPXSP; COMPXSP;
COMPYSP; COMPYSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_scalb(ieee754sp x, int n) union ieee754sp ieee754sp_scalb(union ieee754sp x, int n)
{ {
COMPXSP; COMPXSP;
...@@ -51,7 +51,7 @@ ieee754sp ieee754sp_scalb(ieee754sp x, int n) ...@@ -51,7 +51,7 @@ ieee754sp ieee754sp_scalb(ieee754sp x, int n)
} }
ieee754sp ieee754sp_ldexp(ieee754sp x, int n) union ieee754sp ieee754sp_ldexp(union ieee754sp x, int n)
{ {
return ieee754sp_scalb(x, n); return ieee754sp_scalb(x, n);
} }
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
#include "ieee754sp.h" #include "ieee754sp.h"
int ieee754sp_finite(ieee754sp x) int ieee754sp_finite(union ieee754sp x)
{ {
return SPBEXP(x) != SP_EMAX + 1 + SP_EBIAS; return SPBEXP(x) != SP_EMAX + 1 + SP_EBIAS;
} }
ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_copysign(union ieee754sp x, union ieee754sp y)
{ {
CLEARCX; CLEARCX;
SPSIGN(x) = SPSIGN(y); SPSIGN(x) = SPSIGN(y);
...@@ -39,7 +39,7 @@ ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y) ...@@ -39,7 +39,7 @@ ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y)
} }
ieee754sp ieee754sp_neg(ieee754sp x) union ieee754sp ieee754sp_neg(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
...@@ -55,7 +55,7 @@ ieee754sp ieee754sp_neg(ieee754sp x) ...@@ -55,7 +55,7 @@ ieee754sp ieee754sp_neg(ieee754sp x)
SPSIGN(x) ^= 1; SPSIGN(x) ^= 1;
if (xc == IEEE754_CLASS_SNAN) { if (xc == IEEE754_CLASS_SNAN) {
ieee754sp y = ieee754sp_indef(); union ieee754sp y = ieee754sp_indef();
SETCX(IEEE754_INVALID_OPERATION); SETCX(IEEE754_INVALID_OPERATION);
SPSIGN(y) = SPSIGN(x); SPSIGN(y) = SPSIGN(x);
return ieee754sp_nanxcpt(y, "neg"); return ieee754sp_nanxcpt(y, "neg");
...@@ -65,7 +65,7 @@ ieee754sp ieee754sp_neg(ieee754sp x) ...@@ -65,7 +65,7 @@ ieee754sp ieee754sp_neg(ieee754sp x)
} }
ieee754sp ieee754sp_abs(ieee754sp x) union ieee754sp ieee754sp_abs(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_sqrt(ieee754sp x) union ieee754sp ieee754sp_sqrt(union ieee754sp x)
{ {
int ix, s, q, m, t, i; int ix, s, q, m, t, i;
unsigned int r; unsigned int r;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
{ {
COMPXSP; COMPXSP;
COMPYSP; COMPYSP;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include "ieee754sp.h" #include "ieee754sp.h"
int ieee754sp_tint(ieee754sp x) int ieee754sp_tint(union ieee754sp x)
{ {
COMPXSP; COMPXSP;
...@@ -113,9 +113,9 @@ int ieee754sp_tint(ieee754sp x) ...@@ -113,9 +113,9 @@ int ieee754sp_tint(ieee754sp x)
} }
unsigned int ieee754sp_tuns(ieee754sp x) unsigned int ieee754sp_tuns(union ieee754sp x)
{ {
ieee754sp hb = ieee754sp_1e31(); union ieee754sp hb = ieee754sp_1e31();
/* what if x < 0 ?? */ /* what if x < 0 ?? */
if (ieee754sp_lt(x, hb)) if (ieee754sp_lt(x, hb))
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ieee754sp.h" #include "ieee754sp.h"
s64 ieee754sp_tlong(ieee754sp x) s64 ieee754sp_tlong(union ieee754sp x)
{ {
COMPXDP; /* <-- need 64-bit mantissa tmp */ COMPXDP; /* <-- need 64-bit mantissa tmp */
...@@ -108,9 +108,9 @@ s64 ieee754sp_tlong(ieee754sp x) ...@@ -108,9 +108,9 @@ s64 ieee754sp_tlong(ieee754sp x)
} }
u64 ieee754sp_tulong(ieee754sp x) u64 ieee754sp_tulong(union ieee754sp x)
{ {
ieee754sp hb = ieee754sp_1e63(); union ieee754sp hb = ieee754sp_1e63();
/* what if x < 0 ?? */ /* what if x < 0 ?? */
if (ieee754sp_lt(x, hb)) if (ieee754sp_lt(x, hb))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment