patch-2.4.20 linux-2.4.20/arch/mips/math-emu/sp_tlong.c
Next file: linux-2.4.20/arch/mips/mips-boards/atlas/Makefile
Previous file: linux-2.4.20/arch/mips/math-emu/sp_tint.c
Back to the patch index
Back to the overall index
- Lines: 54
- Date:
Thu Nov 28 15:53:10 2002
- Orig file:
linux-2.4.19/arch/mips/math-emu/sp_tlong.c
- Orig date:
Fri Aug 2 17:39:43 2002
diff -urN linux-2.4.19/arch/mips/math-emu/sp_tlong.c linux-2.4.20/arch/mips/math-emu/sp_tlong.c
@@ -27,7 +27,7 @@
#include "ieee754sp.h"
-long long ieee754sp_tlong(ieee754sp x)
+s64 ieee754sp_tlong(ieee754sp x)
{
COMPXDP; /* <-- need 64-bit mantissa tmp */
@@ -51,7 +51,7 @@
if (xe >= 63) {
/* look for valid corner case */
if (xe == 63 && xs && xm == SP_HIDDEN_BIT)
- return -9223372036854775808LL;
+ return -0x8000000000000000LL;
/* Set invalid. We will only use overflow for floating
point overflow */
SETCX(IEEE754_INVALID_OPERATION);
@@ -61,7 +61,7 @@
if (xe > SP_MBITS) {
xm <<= xe - SP_MBITS;
} else if (xe < SP_MBITS) {
- unsigned long residue;
+ u32 residue;
int round;
int sticky;
int odd;
@@ -98,7 +98,7 @@
if ((xm >> 63) != 0) {
/* This can happen after rounding */
SETCX(IEEE754_INVALID_OPERATION);
- return ieee754si_xcpt(ieee754di_indef(), "sp_tlong", x);
+ return ieee754di_xcpt(ieee754di_indef(), "sp_tlong", x);
}
if (round || sticky)
SETCX(IEEE754_INEXACT);
@@ -110,14 +110,14 @@
}
-unsigned long long ieee754sp_tulong(ieee754sp x)
+u64 ieee754sp_tulong(ieee754sp x)
{
ieee754sp hb = ieee754sp_1e63();
/* what if x < 0 ?? */
if (ieee754sp_lt(x, hb))
- return (unsigned long long) ieee754sp_tlong(x);
+ return (u64) ieee754sp_tlong(x);
- return (unsigned long long) ieee754sp_tlong(ieee754sp_sub(x, hb)) |
+ return (u64) ieee754sp_tlong(ieee754sp_sub(x, hb)) |
(1ULL << 63);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)