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

MIPS: math-emu: Get rid of typedefs.

parent 23708818
Loading
Loading
Loading
Loading
+33 −33
Original line number Original line Diff line number Diff line
@@ -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, \
	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,
	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,
	}
	}


	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,
	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,
	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,
			/* 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,
			}
			}
		      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,
		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,
			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,
		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,


#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,
		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,
		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,


	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,


			/* 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,
				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,


			/* 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,
			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,
		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,


#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,
		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,
		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,
	}
	}


	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:
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+2 −2
Original line number Original line Diff line number Diff line
@@ -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)
#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(),
Loading