Remove (the now non-compiling) support for 128bit FP emulation, which

isn't needed for PowerPC anyway.
This commit is contained in:
simonb 2003-10-27 04:32:02 +00:00
parent 354075932d
commit 499ef1c1bb
4 changed files with 8 additions and 106 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpu_explode.c,v 1.3 2003/08/07 16:29:18 agc Exp $ */
/* $NetBSD: fpu_explode.c,v 1.4 2003/10/27 04:32:02 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.3 2003/08/07 16:29:18 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.4 2003/10/27 04:32:02 simonb Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@ -199,29 +199,6 @@ fpu_dtof(struct fpn *fp, u_int i, u_int j)
FP_TOF(exp, DBL_EXP_BIAS, frac, f0, f1, f2, 0);
}
/*
* 128-bit extended -> fpn.
*/
int
fpu_qtof(struct fpn *fp, u_int i, u_int j, u_int k, u_int l)
{
int exp;
u_int frac, f0, f1, f2, f3;
#define EXT_SHIFT (-(EXT_FRACBITS - 3 * 32 - FP_LG)) /* left shift! */
/*
* Note that ext and fpn `line up', hence no shifting needed.
*/
exp = (i >> (32 - 1 - EXT_EXPBITS)) & mask(EXT_EXPBITS);
frac = i & mask(EXT_FRACBITS - 3 * 32);
f0 = (frac << EXT_SHIFT) | (j >> (32 - EXT_SHIFT));
f1 = (j << EXT_SHIFT) | (k >> (32 - EXT_SHIFT));
f2 = (k << EXT_SHIFT) | (l >> (32 - EXT_SHIFT));
f3 = l << EXT_SHIFT;
frac |= j | k | l;
FP_TOF(exp, EXT_EXP_BIAS, frac, f0, f1, f2, f3);
}
/*
* Explode the contents of a register / regpair / regquad.
* If the input is a signalling NaN, an NV (invalid) exception
@ -258,12 +235,8 @@ fpu_explode(struct fpemu *fe, struct fpn *fp, int type, int reg)
s = fpu_dtof(fp, s, space[1]);
break;
case FTYPE_EXT:
s = fpu_qtof(fp, s, space[1], space[2], space[3]);
break;
default:
panic("fpu_explode");
panic("fpu_explode: invalid type %d", type);
}
if (s == FPC_QNAN && (fp->fp_mant[0] & FP_QUIETBIT) == 0) {
@ -282,8 +255,7 @@ fpu_explode(struct fpemu *fe, struct fpn *fp, int type, int reg)
DPRINTF(FPE_REG, ("fpu_explode: %%%c%d => ", (type == FTYPE_LNG) ? 'x' :
((type == FTYPE_INT) ? 'i' :
((type == FTYPE_SNG) ? 's' :
((type == FTYPE_DBL) ? 'd' :
((type == FTYPE_EXT) ? 'q' : '?')))),
((type == FTYPE_DBL) ? 'd' : ?))),
reg));
DUMPFPN(FPE_REG, fp);
DPRINTF(FPE_REG, ("\n"));

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpu_extern.h,v 1.1 2001/06/13 06:01:47 simonb Exp $ */
/* $NetBSD: fpu_extern.h,v 1.2 2003/10/27 04:32:02 simonb Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -61,7 +61,6 @@ int fpu_itof(struct fpn *, u_int);
int fpu_xtof(struct fpn *, u_int64_t);
int fpu_stof(struct fpn *, u_int);
int fpu_dtof(struct fpn *, u_int, u_int);
int fpu_qtof(struct fpn *, u_int, u_int , u_int , u_int);
void fpu_explode(struct fpemu *, struct fpn *, int, int);
/* fpu_implode.c */
@ -69,7 +68,6 @@ u_int fpu_ftoi(struct fpemu *, struct fpn *);
u_int fpu_ftox(struct fpemu *, struct fpn *, u_int *);
u_int fpu_ftos(struct fpemu *, struct fpn *);
u_int fpu_ftod(struct fpemu *, struct fpn *, u_int *);
u_int fpu_ftoq(struct fpemu *, struct fpn *, u_int *);
void fpu_implode(struct fpemu *, struct fpn *, int, u_int *);
/* fpu_mul.c */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpu_implode.c,v 1.3 2003/08/07 16:29:18 agc Exp $ */
/* $NetBSD: fpu_implode.c,v 1.4 2003/10/27 04:32:02 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fpu_implode.c,v 1.3 2003/08/07 16:29:18 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: fpu_implode.c,v 1.4 2003/10/27 04:32:02 simonb Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@ -420,66 +420,6 @@ done:
return (sign | DBL_EXP(exp) | (fp->fp_mant[2] & DBL_MASK));
}
/*
* fpn -> extended (32 bit high-order result returned; low-order fraction
* words left in res[1]..res[3]). Like ftod, which is like ftos ... but
* our internal format *is* extended precision, plus 2 bits for guard/round,
* so we can avoid a small bit of work.
*/
u_int
fpu_ftoq(struct fpemu *fe, struct fpn *fp, u_int *res)
{
u_int sign = fp->fp_sign << 31;
int exp;
#define EXT_EXP(e) ((e) << (EXT_FRACBITS & 31))
#define EXT_MASK (EXT_EXP(1) - 1)
if (ISNAN(fp)) {
(void) fpu_shr(fp, 2); /* since we are not rounding */
exp = EXT_EXP_INFNAN;
goto done;
}
if (ISINF(fp)) {
sign |= EXT_EXP(EXT_EXP_INFNAN);
goto zero;
}
if (ISZERO(fp)) {
zero: res[1] = res[2] = res[3] = 0;
return (sign);
}
if ((exp = fp->fp_exp + EXT_EXP_BIAS) <= 0) {
(void) fpu_shr(fp, FP_NMANT - FP_NG - EXT_FRACBITS - exp);
if (round(fe, fp) && fp->fp_mant[0] == EXT_EXP(1)) {
res[1] = res[2] = res[3] = 0;
return (sign | EXT_EXP(1) | 0);
}
if ((fe->fe_cx & FPSCR_FI) ||
(fe->fe_fpscr & FPSCR_UX))
fe->fe_cx |= FPSCR_UX;
exp = 0;
goto done;
}
/* Since internal == extended, no need to shift here. */
if (round(fe, fp) && fp->fp_mant[0] == EXT_EXP(2))
exp++;
if (exp >= EXT_EXP_INFNAN) {
fe->fe_cx |= FPSCR_OX | FPSCR_UX;
if (toinf(fe, sign)) {
res[1] = res[2] = res[3] = 0;
return (sign | EXT_EXP(EXT_EXP_INFNAN) | 0);
}
res[1] = res[2] = res[3] = ~0;
return (sign | EXT_EXP(EXT_EXP_INFNAN) | EXT_MASK);
}
done:
res[1] = fp->fp_mant[1];
res[2] = fp->fp_mant[2];
res[3] = fp->fp_mant[3];
return (sign | EXT_EXP(exp) | (fp->fp_mant[0] & EXT_MASK));
}
/*
* Implode an fpn, writing the result into the given space.
*/
@ -514,13 +454,6 @@ fpu_implode(struct fpemu *fe, struct fpn *fp, int type, u_int *space)
space[0], space[1]));
break; break;
case FTYPE_EXT:
/* funky rounding precision options ?? */
space[0] = fpu_ftoq(fe, fp, space);
DPRINTF(FPE_REG, ("fpu_implode: long double %x %x %x %x\n",
space[0], space[1], space[2], space[3]));
break; break;
default:
panic("fpu_implode: invalid type %d", type);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: instr.h,v 1.2 2003/08/07 16:29:18 agc Exp $ */
/* $NetBSD: instr.h,v 1.3 2003/10/27 04:32:02 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -383,7 +383,6 @@ union instr {
#define FTYPE_INT 0 /* data = 32-bit signed integer */
#define FTYPE_SNG 1 /* data = 32-bit float */
#define FTYPE_DBL 2 /* data = 64-bit double */
#define FTYPE_EXT 3 /* data = 128-bit extended (quad-prec) */
/*
* FPCSR rounding modes.