From dfbf42b844a5f307bd66716da65f01be9107bc0b Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 25 Apr 2014 00:29:50 +0200 Subject: [PATCH] MIPS: math-emu: Remove unused code. Shrinks the FPU emulator by 4528 bytes. Signed-off-by: Ralf Baechle --- arch/mips/math-emu/Makefile | 13 +++--- arch/mips/math-emu/dp_fint.c | 8 ---- arch/mips/math-emu/dp_flong.c | 8 ---- arch/mips/math-emu/dp_frexp.c | 52 ---------------------- arch/mips/math-emu/dp_logb.c | 53 ----------------------- arch/mips/math-emu/dp_modf.c | 79 ---------------------------------- arch/mips/math-emu/dp_scalb.c | 57 ------------------------ arch/mips/math-emu/dp_simple.c | 8 ---- arch/mips/math-emu/dp_tint.c | 13 ------ arch/mips/math-emu/dp_tlong.c | 13 ------ arch/mips/math-emu/ieee754.h | 53 ----------------------- arch/mips/math-emu/ieee754m.c | 55 ----------------------- arch/mips/math-emu/sp_fint.c | 9 ---- arch/mips/math-emu/sp_flong.c | 9 ---- arch/mips/math-emu/sp_frexp.c | 52 ---------------------- arch/mips/math-emu/sp_logb.c | 53 ----------------------- arch/mips/math-emu/sp_modf.c | 79 ---------------------------------- arch/mips/math-emu/sp_scalb.c | 57 ------------------------ arch/mips/math-emu/sp_simple.c | 8 ---- arch/mips/math-emu/sp_tint.c | 13 ------ arch/mips/math-emu/sp_tlong.c | 13 ------ 21 files changed, 6 insertions(+), 699 deletions(-) delete mode 100644 arch/mips/math-emu/dp_frexp.c delete mode 100644 arch/mips/math-emu/dp_logb.c delete mode 100644 arch/mips/math-emu/dp_modf.c delete mode 100644 arch/mips/math-emu/dp_scalb.c delete mode 100644 arch/mips/math-emu/ieee754m.c delete mode 100644 arch/mips/math-emu/sp_frexp.c delete mode 100644 arch/mips/math-emu/sp_logb.c delete mode 100644 arch/mips/math-emu/sp_modf.c delete mode 100644 arch/mips/math-emu/sp_scalb.c diff --git a/arch/mips/math-emu/Makefile b/arch/mips/math-emu/Makefile index 0803970dfc16..363ce9bd82ea 100644 --- a/arch/mips/math-emu/Makefile +++ b/arch/mips/math-emu/Makefile @@ -2,12 +2,11 @@ # Makefile for the Linux/MIPS kernel FPU emulation. # -obj-y := cp1emu.o ieee754m.o ieee754d.o ieee754dp.o ieee754sp.o ieee754.o \ - ieee754xcpt.o dp_frexp.o dp_modf.o dp_div.o dp_mul.o dp_sub.o \ - dp_add.o dp_fsp.o dp_cmp.o dp_logb.o dp_scalb.o dp_simple.o \ - dp_tint.o dp_fint.o dp_tlong.o dp_flong.o sp_frexp.o sp_modf.o \ - sp_div.o sp_mul.o sp_sub.o sp_add.o sp_fdp.o sp_cmp.o sp_logb.o \ - sp_scalb.o sp_simple.o sp_tint.o sp_fint.o sp_tlong.o sp_flong.o \ - dp_sqrt.o sp_sqrt.o kernel_linkage.o dsemul.o +obj-y := cp1emu.o ieee754d.o ieee754dp.o ieee754sp.o ieee754.o \ + ieee754xcpt.o dp_div.o dp_mul.o dp_sub.o dp_add.o dp_fsp.o \ + dp_cmp.o dp_simple.o dp_tint.o dp_fint.o dp_tlong.o dp_flong.o \ + sp_div.o sp_mul.o sp_sub.o sp_add.o sp_fdp.o sp_cmp.o sp_simple.o \ + sp_tint.o sp_fint.o sp_tlong.o sp_flong.o dp_sqrt.o sp_sqrt.o \ + kernel_linkage.o dsemul.o obj-$(CONFIG_DEBUG_FS) += me-debugfs.o diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c index 196a010ff09d..98b9d6a14027 100644 --- a/arch/mips/math-emu/dp_fint.c +++ b/arch/mips/math-emu/dp_fint.c @@ -59,11 +59,3 @@ union ieee754dp ieee754dp_fint(int x) } return builddp(xs, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT); } - -union ieee754dp ieee754dp_funs(unsigned int u) -{ - if ((int) u < 0) - return ieee754dp_add(ieee754dp_1e31(), - ieee754dp_fint(u & ~(1 << 31))); - return ieee754dp_fint(u); -} diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c index 915072d82c20..fb5eeaadf253 100644 --- a/arch/mips/math-emu/dp_flong.c +++ b/arch/mips/math-emu/dp_flong.c @@ -67,11 +67,3 @@ union ieee754dp ieee754dp_flong(s64 x) } DPNORMRET1(xs, xe, xm, "dp_flong", x); } - -union ieee754dp ieee754dp_fulong(u64 u) -{ - if ((s64) u < 0) - return ieee754dp_add(ieee754dp_1e63(), - ieee754dp_flong(u & ~(1ULL << 63))); - return ieee754dp_flong(u); -} diff --git a/arch/mips/math-emu/dp_frexp.c b/arch/mips/math-emu/dp_frexp.c deleted file mode 100644 index 25ebce16143e..000000000000 --- a/arch/mips/math-emu/dp_frexp.c +++ /dev/null @@ -1,52 +0,0 @@ -/* IEEE754 floating point arithmetic - * double precision: common utilities - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754dp.h" - -/* close to ieeep754dp_logb -*/ -union ieee754dp ieee754dp_frexp(union ieee754dp x, int *eptr) -{ - COMPXDP; - ieee754_clearcx(); - EXPLODEXDP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - *eptr = 0; - return x; - case IEEE754_CLASS_DNORM: - DPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - *eptr = xe + 1; - return builddp(xs, -1 + DP_EBIAS, xm & ~DP_HIDDEN_BIT); -} diff --git a/arch/mips/math-emu/dp_logb.c b/arch/mips/math-emu/dp_logb.c deleted file mode 100644 index b412c90355cd..000000000000 --- a/arch/mips/math-emu/dp_logb.c +++ /dev/null @@ -1,53 +0,0 @@ -/* IEEE754 floating point arithmetic - * double precision: common utilities - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754dp.h" - -union ieee754dp ieee754dp_logb(union ieee754dp x) -{ - COMPXDP; - - ieee754_clearcx(); - - EXPLODEXDP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - return ieee754dp_nanxcpt(x, "logb", x); - case IEEE754_CLASS_QNAN: - return x; - case IEEE754_CLASS_INF: - return ieee754dp_inf(0); - case IEEE754_CLASS_ZERO: - return ieee754dp_inf(1); - case IEEE754_CLASS_DNORM: - DPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - return ieee754dp_fint(xe); -} diff --git a/arch/mips/math-emu/dp_modf.c b/arch/mips/math-emu/dp_modf.c deleted file mode 100644 index d83ec44f1a33..000000000000 --- a/arch/mips/math-emu/dp_modf.c +++ /dev/null @@ -1,79 +0,0 @@ -/* IEEE754 floating point arithmetic - * double precision: common utilities - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754dp.h" - -/* modf function is always exact for a finite number -*/ -union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp *ip) -{ - COMPXDP; - - ieee754_clearcx(); - - EXPLODEXDP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - *ip = x; - return x; - case IEEE754_CLASS_DNORM: - /* far to small */ - *ip = ieee754dp_zero(xs); - return x; - case IEEE754_CLASS_NORM: - break; - } - if (xe < 0) { - *ip = ieee754dp_zero(xs); - return x; - } - if (xe >= DP_FBITS) { - *ip = x; - return ieee754dp_zero(xs); - } - /* generate ipart mantissa by clearing bottom bits - */ - *ip = builddp(xs, xe + DP_EBIAS, - ((xm >> (DP_FBITS - xe)) << (DP_FBITS - xe)) & - ~DP_HIDDEN_BIT); - - /* generate fpart mantissa by clearing top bits - * and normalizing (must be able to normalize) - */ - xm = (xm << (64 - (DP_FBITS - xe))) >> (64 - (DP_FBITS - xe)); - if (xm == 0) - return ieee754dp_zero(xs); - - while ((xm >> DP_FBITS) == 0) { - xm <<= 1; - xe--; - } - return builddp(xs, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT); -} diff --git a/arch/mips/math-emu/dp_scalb.c b/arch/mips/math-emu/dp_scalb.c deleted file mode 100644 index dee37551fae1..000000000000 --- a/arch/mips/math-emu/dp_scalb.c +++ /dev/null @@ -1,57 +0,0 @@ -/* IEEE754 floating point arithmetic - * double precision: common utilities - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754dp.h" - -union ieee754dp ieee754dp_scalb(union ieee754dp x, int n) -{ - COMPXDP; - - ieee754_clearcx(); - - EXPLODEXDP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - return ieee754dp_nanxcpt(x, "scalb", x, n); - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - return x; - case IEEE754_CLASS_DNORM: - DPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - DPNORMRET2(xs, xe + n, xm << 3, "scalb", x, n); -} - - -union ieee754dp ieee754dp_ldexp(union ieee754dp x, int n) -{ - return ieee754dp_scalb(x, n); -} diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c index cae11b0454c6..fddeb33107dd 100644 --- a/arch/mips/math-emu/dp_simple.c +++ b/arch/mips/math-emu/dp_simple.c @@ -26,14 +26,6 @@ #include "ieee754dp.h" -union ieee754dp ieee754dp_copysign(union ieee754dp x, union ieee754dp y) -{ - ieee754_clearcx(); - DPSIGN(x) = DPSIGN(y); - return x; -} - - union ieee754dp ieee754dp_neg(union ieee754dp x) { COMPXDP; diff --git a/arch/mips/math-emu/dp_tint.c b/arch/mips/math-emu/dp_tint.c index 8c39a40d7fe9..1270009aee9b 100644 --- a/arch/mips/math-emu/dp_tint.c +++ b/arch/mips/math-emu/dp_tint.c @@ -106,16 +106,3 @@ int ieee754dp_tint(union ieee754dp x) else return xm; } - - -unsigned int ieee754dp_tuns(union ieee754dp x) -{ - union ieee754dp hb = ieee754dp_1e31(); - - /* what if x < 0 ?? */ - if (ieee754dp_lt(x, hb)) - return (unsigned) ieee754dp_tint(x); - - return (unsigned) ieee754dp_tint(ieee754dp_sub(x, hb)) | - ((unsigned) 1 << 31); -} diff --git a/arch/mips/math-emu/dp_tlong.c b/arch/mips/math-emu/dp_tlong.c index 2653b6eac689..b9a43a2d4b36 100644 --- a/arch/mips/math-emu/dp_tlong.c +++ b/arch/mips/math-emu/dp_tlong.c @@ -110,16 +110,3 @@ s64 ieee754dp_tlong(union ieee754dp x) else return xm; } - - -u64 ieee754dp_tulong(union ieee754dp x) -{ - union ieee754dp hb = ieee754dp_1e63(); - - /* what if x < 0 ?? */ - if (ieee754dp_lt(x, hb)) - return (u64) ieee754dp_tlong(x); - - return (u64) ieee754dp_tlong(ieee754dp_sub(x, hb)) | - (1ULL << 63); -} diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h index 7466230da5b8..a62aa5a40af9 100644 --- a/arch/mips/math-emu/ieee754.h +++ b/arch/mips/math-emu/ieee754.h @@ -72,11 +72,6 @@ int ieee754sp_class(union ieee754sp x); union ieee754sp ieee754sp_abs(union ieee754sp x); union ieee754sp ieee754sp_neg(union ieee754sp x); -union ieee754sp ieee754sp_scalb(union ieee754sp x, int); -union ieee754sp ieee754sp_logb(union ieee754sp x); - -/* x with sign of y */ -union ieee754sp ieee754sp_copysign(union ieee754sp x, union ieee754sp y); union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y); union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y); @@ -84,27 +79,13 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y); union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y); union ieee754sp ieee754sp_fint(int x); -union ieee754sp ieee754sp_funs(unsigned x); union ieee754sp ieee754sp_flong(s64 x); -union ieee754sp ieee754sp_fulong(u64 x); union ieee754sp ieee754sp_fdp(union ieee754dp x); int ieee754sp_tint(union ieee754sp x); -unsigned int ieee754sp_tuns(union ieee754sp x); s64 ieee754sp_tlong(union ieee754sp x); -u64 ieee754sp_tulong(union ieee754sp x); int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cop, int sig); -/* - * basic sp math - */ -union ieee754sp ieee754sp_modf(union ieee754sp x, union ieee754sp * ip); -union ieee754sp ieee754sp_frexp(union ieee754sp x, int *exp); -union ieee754sp ieee754sp_ldexp(union ieee754sp x, int exp); - -union ieee754sp ieee754sp_ceil(union ieee754sp x); -union ieee754sp ieee754sp_floor(union ieee754sp x); -union ieee754sp ieee754sp_trunc(union ieee754sp x); union ieee754sp ieee754sp_sqrt(union ieee754sp x); @@ -113,9 +94,6 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x); */ int ieee754dp_class(union ieee754dp x); -/* x with sign of y */ -union ieee754dp ieee754dp_copysign(union ieee754dp x, union ieee754dp y); - union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y); union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y); union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y); @@ -123,38 +101,15 @@ union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y); union ieee754dp ieee754dp_abs(union ieee754dp x); union ieee754dp ieee754dp_neg(union ieee754dp x); -union ieee754dp ieee754dp_scalb(union ieee754dp x, int); - -/* return exponent as integer in floating point format - */ -union ieee754dp ieee754dp_logb(union ieee754dp x); union ieee754dp ieee754dp_fint(int x); -union ieee754dp ieee754dp_funs(unsigned x); union ieee754dp ieee754dp_flong(s64 x); -union ieee754dp ieee754dp_fulong(u64 x); union ieee754dp ieee754dp_fsp(union ieee754sp x); -union ieee754dp ieee754dp_ceil(union ieee754dp x); -union ieee754dp ieee754dp_floor(union ieee754dp x); -union ieee754dp ieee754dp_trunc(union ieee754dp x); - int ieee754dp_tint(union ieee754dp x); -unsigned int ieee754dp_tuns(union ieee754dp x); s64 ieee754dp_tlong(union ieee754dp x); -u64 ieee754dp_tulong(union ieee754dp x); int ieee754dp_cmp(union ieee754dp x, union ieee754dp y, int cop, int sig); -/* - * basic sp math - */ -union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp * ip); -union ieee754dp ieee754dp_frexp(union ieee754dp x, int *exp); -union ieee754dp ieee754dp_ldexp(union ieee754dp x, int exp); - -union ieee754dp ieee754dp_ceil(union ieee754dp x); -union ieee754dp ieee754dp_floor(union ieee754dp x); -union ieee754dp ieee754dp_trunc(union ieee754dp x); union ieee754dp ieee754dp_sqrt(union ieee754dp x); @@ -261,14 +216,6 @@ static inline int ieee754dp_ge(union ieee754dp x, union ieee754dp y) return ieee754dp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); } - -/* - * Like strtod - */ -union ieee754dp ieee754dp_fstr(const char *s, char **endp); -char *ieee754dp_tstr(union ieee754dp x, int prec, int fmt, int af); - - /* * The control status register */ diff --git a/arch/mips/math-emu/ieee754m.c b/arch/mips/math-emu/ieee754m.c deleted file mode 100644 index 06224064333b..000000000000 --- a/arch/mips/math-emu/ieee754m.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * floor, trunc, ceil - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754.h" - -union ieee754dp ieee754dp_floor(union ieee754dp x) -{ - union ieee754dp i; - - if (ieee754dp_lt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) - return ieee754dp_sub(i, ieee754dp_one(0)); - else - return i; -} - -union ieee754dp ieee754dp_ceil(union ieee754dp x) -{ - union ieee754dp i; - - if (ieee754dp_gt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) - return ieee754dp_add(i, ieee754dp_one(0)); - else - return i; -} - -union ieee754dp ieee754dp_trunc(union ieee754dp x) -{ - union ieee754dp i; - - (void) ieee754dp_modf(x, &i); - return i; -} diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c index 9574d25f6122..0d01200793d1 100644 --- a/arch/mips/math-emu/sp_fint.c +++ b/arch/mips/math-emu/sp_fint.c @@ -68,12 +68,3 @@ union ieee754sp ieee754sp_fint(int x) } SPNORMRET1(xs, xe, xm, "fint", x); } - - -union ieee754sp ieee754sp_funs(unsigned int u) -{ - if ((int) u < 0) - return ieee754sp_add(ieee754sp_1e31(), - ieee754sp_fint(u & ~(1 << 31))); - return ieee754sp_fint(u); -} diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c index 65c7e7e67b60..b26c155cc3e6 100644 --- a/arch/mips/math-emu/sp_flong.c +++ b/arch/mips/math-emu/sp_flong.c @@ -67,12 +67,3 @@ union ieee754sp ieee754sp_flong(s64 x) } SPNORMRET1(xs, xe, xm, "sp_flong", x); } - - -union ieee754sp ieee754sp_fulong(u64 u) -{ - if ((s64) u < 0) - return ieee754sp_add(ieee754sp_1e63(), - ieee754sp_flong(u & ~(1ULL << 63))); - return ieee754sp_flong(u); -} diff --git a/arch/mips/math-emu/sp_frexp.c b/arch/mips/math-emu/sp_frexp.c deleted file mode 100644 index 72cedb088506..000000000000 --- a/arch/mips/math-emu/sp_frexp.c +++ /dev/null @@ -1,52 +0,0 @@ -/* IEEE754 floating point arithmetic - * single precision - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754sp.h" - -/* close to ieeep754sp_logb -*/ -union ieee754sp ieee754sp_frexp(union ieee754sp x, int *eptr) -{ - COMPXSP; - ieee754_clearcx(); - EXPLODEXSP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - *eptr = 0; - return x; - case IEEE754_CLASS_DNORM: - SPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - *eptr = xe + 1; - return buildsp(xs, -1 + SP_EBIAS, xm & ~SP_HIDDEN_BIT); -} diff --git a/arch/mips/math-emu/sp_logb.c b/arch/mips/math-emu/sp_logb.c deleted file mode 100644 index 82c122c9a447..000000000000 --- a/arch/mips/math-emu/sp_logb.c +++ /dev/null @@ -1,53 +0,0 @@ -/* IEEE754 floating point arithmetic - * single precision - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754sp.h" - -union ieee754sp ieee754sp_logb(union ieee754sp x) -{ - COMPXSP; - - ieee754_clearcx(); - - EXPLODEXSP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - return ieee754sp_nanxcpt(x, "logb", x); - case IEEE754_CLASS_QNAN: - return x; - case IEEE754_CLASS_INF: - return ieee754sp_inf(0); - case IEEE754_CLASS_ZERO: - return ieee754sp_inf(1); - case IEEE754_CLASS_DNORM: - SPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - return ieee754sp_fint(xe); -} diff --git a/arch/mips/math-emu/sp_modf.c b/arch/mips/math-emu/sp_modf.c deleted file mode 100644 index 5f361a7a10b6..000000000000 --- a/arch/mips/math-emu/sp_modf.c +++ /dev/null @@ -1,79 +0,0 @@ -/* IEEE754 floating point arithmetic - * single precision - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754sp.h" - -/* modf function is always exact for a finite number -*/ -union ieee754sp ieee754sp_modf(union ieee754sp x, union ieee754sp *ip) -{ - COMPXSP; - - ieee754_clearcx(); - - EXPLODEXSP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - *ip = x; - return x; - case IEEE754_CLASS_DNORM: - /* far to small */ - *ip = ieee754sp_zero(xs); - return x; - case IEEE754_CLASS_NORM: - break; - } - if (xe < 0) { - *ip = ieee754sp_zero(xs); - return x; - } - if (xe >= SP_FBITS) { - *ip = x; - return ieee754sp_zero(xs); - } - /* generate ipart mantissa by clearing bottom bits - */ - *ip = buildsp(xs, xe + SP_EBIAS, - ((xm >> (SP_FBITS - xe)) << (SP_FBITS - xe)) & - ~SP_HIDDEN_BIT); - - /* generate fpart mantissa by clearing top bits - * and normalizing (must be able to normalize) - */ - xm = (xm << (32 - (SP_FBITS - xe))) >> (32 - (SP_FBITS - xe)); - if (xm == 0) - return ieee754sp_zero(xs); - - while ((xm >> SP_FBITS) == 0) { - xm <<= 1; - xe--; - } - return buildsp(xs, xe + SP_EBIAS, xm & ~SP_HIDDEN_BIT); -} diff --git a/arch/mips/math-emu/sp_scalb.c b/arch/mips/math-emu/sp_scalb.c deleted file mode 100644 index cc8f1b82d2a9..000000000000 --- a/arch/mips/math-emu/sp_scalb.c +++ /dev/null @@ -1,57 +0,0 @@ -/* IEEE754 floating point arithmetic - * single precision - */ -/* - * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. - * - * ######################################################################## - * - * This program is free software; you can distribute it and/or modify it - * under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * ######################################################################## - */ - - -#include "ieee754sp.h" - -union ieee754sp ieee754sp_scalb(union ieee754sp x, int n) -{ - COMPXSP; - - ieee754_clearcx(); - - EXPLODEXSP; - - switch (xc) { - case IEEE754_CLASS_SNAN: - return ieee754sp_nanxcpt(x, "scalb", x, n); - case IEEE754_CLASS_QNAN: - case IEEE754_CLASS_INF: - case IEEE754_CLASS_ZERO: - return x; - case IEEE754_CLASS_DNORM: - SPDNORMX; - break; - case IEEE754_CLASS_NORM: - break; - } - SPNORMRET2(xs, xe + n, xm << 3, "scalb", x, n); -} - - -union ieee754sp ieee754sp_ldexp(union ieee754sp x, int n) -{ - return ieee754sp_scalb(x, n); -} diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c index b63e9fb7ef4e..0f5fd57e2cac 100644 --- a/arch/mips/math-emu/sp_simple.c +++ b/arch/mips/math-emu/sp_simple.c @@ -26,14 +26,6 @@ #include "ieee754sp.h" -union ieee754sp ieee754sp_copysign(union ieee754sp x, union ieee754sp y) -{ - ieee754_clearcx(); - SPSIGN(x) = SPSIGN(y); - return x; -} - - union ieee754sp ieee754sp_neg(union ieee754sp x) { COMPXSP; diff --git a/arch/mips/math-emu/sp_tint.c b/arch/mips/math-emu/sp_tint.c index 709f6bcd490b..690cb5b4cfa8 100644 --- a/arch/mips/math-emu/sp_tint.c +++ b/arch/mips/math-emu/sp_tint.c @@ -110,16 +110,3 @@ int ieee754sp_tint(union ieee754sp x) else return xm; } - - -unsigned int ieee754sp_tuns(union ieee754sp x) -{ - union ieee754sp hb = ieee754sp_1e31(); - - /* what if x < 0 ?? */ - if (ieee754sp_lt(x, hb)) - return (unsigned) ieee754sp_tint(x); - - return (unsigned) ieee754sp_tint(ieee754sp_sub(x, hb)) | - ((unsigned) 1 << 31); -} diff --git a/arch/mips/math-emu/sp_tlong.c b/arch/mips/math-emu/sp_tlong.c index e979aa757079..346cbad4a1ae 100644 --- a/arch/mips/math-emu/sp_tlong.c +++ b/arch/mips/math-emu/sp_tlong.c @@ -107,16 +107,3 @@ s64 ieee754sp_tlong(union ieee754sp x) else return xm; } - - -u64 ieee754sp_tulong(union ieee754sp x) -{ - union ieee754sp hb = ieee754sp_1e63(); - - /* what if x < 0 ?? */ - if (ieee754sp_lt(x, hb)) - return (u64) ieee754sp_tlong(x); - - return (u64) ieee754sp_tlong(ieee754sp_sub(x, hb)) | - (1ULL << 63); -} -- 2.39.2