Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/m68k/fpe pullup 1.9->1.10 (briggs): fix FPE
details: https://anonhg.NetBSD.org/src/rev/739ed0b09eea
branches: netbsd-1-4
changeset: 468803:739ed0b09eea
user: perry <perry%NetBSD.org@localhost>
date: Mon Jun 21 15:19:30 1999 +0000
description:
pullup 1.9->1.10 (briggs): fix FPE
diffstat:
sys/arch/m68k/fpe/fpu_fscale.c | 106 ++++++++++++++++++++--------------------
1 files changed, 53 insertions(+), 53 deletions(-)
diffs (164 lines):
diff -r e0ebf225226d -r 739ed0b09eea sys/arch/m68k/fpe/fpu_fscale.c
--- a/sys/arch/m68k/fpe/fpu_fscale.c Mon Jun 21 15:19:15 1999 +0000
+++ b/sys/arch/m68k/fpe/fpu_fscale.c Mon Jun 21 15:19:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu_fscale.c,v 1.9 1997/11/03 11:10:41 is Exp $ */
+/* $NetBSD: fpu_fscale.c,v 1.9.8.1 1999/06/21 15:19:30 perry Exp $ */
/*
* Copyright (c) 1995 Ken Nakata
@@ -56,17 +56,19 @@
int scale, sign, exp;
u_int m0, m1;
u_int buf[3], fpsr;
+#if DEBUG_FPE
int flags;
char regname;
+#endif
scale = sig = 0;
frame = fe->fe_frame;
fpregs = &(fe->fe_fpframe->fpf_regs[0]);
/* clear all exceptions and conditions */
fpsr = fe->fe_fpsr & ~FPSR_EXCP & ~FPSR_CCB;
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: FPSR = %08x, FPCR = %08x\n", fpsr, fe->fe_fpcr);
- }
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: FPSR = %08x, FPCR = %08x\n", fpsr, fe->fe_fpcr);
+#endif
word1 = insn->is_word1;
format = (word1 >> 10) & 7;
@@ -77,16 +79,14 @@
/* get the source operand */
if ((word1 & 0x4000) == 0) {
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: FP%d op FP%d => FP%d\n",
- format, regnum, regnum);
- }
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: FP%d op FP%d => FP%d\n",
+ format, regnum, regnum);
/* the operand is an FP reg */
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_scale: src opr FP%d=%08x%08x%08x\n",
- format, fpregs[format*3], fpregs[format*3+1],
- fpregs[format*3+2]);
- }
+ printf("fpu_emul_scale: src opr FP%d=%08x%08x%08x\n",
+ format, fpregs[format*3], fpregs[format*3+1],
+ fpregs[format*3+2]);
+#endif
fpu_explode(fe, &fe->fe_f2, FTYPE_EXT, &fpregs[format * 3]);
fpu_implode(fe, &fe->fe_f2, FTYPE_LNG, buf);
scale = buf[0];
@@ -109,48 +109,48 @@
}
/* Get effective address. (modreg=opcode&077) */
- sig = fpu_decode_ea(frame, insn, &insn->is_ea0, insn->is_opcode);
+ sig = fpu_decode_ea(frame, insn, &insn->is_ea, insn->is_opcode);
if (sig) {
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: error in decode_ea\n");
- }
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: error in decode_ea\n");
+#endif
return sig;
}
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: addr mode = ");
- flags = insn->is_ea0.ea_flags;
- regname = (insn->is_ea0.ea_regnum & 8) ? 'a' : 'd';
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: addr mode = ");
+ flags = insn->is_ea.ea_flags;
+ regname = (insn->is_ea.ea_regnum & 8) ? 'a' : 'd';
- if (flags & EA_DIRECT) {
- printf("%c%d\n", regname, insn->is_ea0.ea_regnum & 7);
- } else if (insn->is_ea0.ea_flags & EA_PREDECR) {
- printf("%c%d@-\n", regname, insn->is_ea0.ea_regnum & 7);
- } else if (insn->is_ea0.ea_flags & EA_POSTINCR) {
- printf("%c%d@+\n", regname, insn->is_ea0.ea_regnum & 7);
- } else if (insn->is_ea0.ea_flags & EA_OFFSET) {
- printf("%c%d@(%d)\n", regname, insn->is_ea0.ea_regnum & 7,
- insn->is_ea0.ea_offset);
- } else if (insn->is_ea0.ea_flags & EA_INDEXED) {
- printf("%c%d@(...)\n", regname, insn->is_ea0.ea_regnum & 7);
- } else if (insn->is_ea0.ea_flags & EA_ABS) {
- printf("0x%08x\n", insn->is_ea0.ea_absaddr);
- } else if (insn->is_ea0.ea_flags & EA_PC_REL) {
- printf("pc@(%d)\n", insn->is_ea0.ea_offset);
- } else if (flags & EA_IMMED) {
- printf("#0x%08x%08x%08x\n",
- insn->is_ea0.ea_immed[0], insn->is_ea0.ea_immed[1],
- insn->is_ea0.ea_immed[2]);
- } else {
- printf("%c%d@\n", regname, insn->is_ea0.ea_regnum & 7);
- }
+ if (flags & EA_DIRECT) {
+ printf("%c%d\n", regname, insn->is_ea.ea_regnum & 7);
+ } else if (flags & EA_PREDECR) {
+ printf("%c%d@-\n", regname, insn->is_ea.ea_regnum & 7);
+ } else if (flags & EA_POSTINCR) {
+ printf("%c%d@+\n", regname, insn->is_ea.ea_regnum & 7);
+ } else if (flags & EA_OFFSET) {
+ printf("%c%d@(%d)\n", regname, insn->is_ea.ea_regnum & 7,
+ insn->is_ea.ea_offset);
+ } else if (flags & EA_INDEXED) {
+ printf("%c%d@(...)\n", regname, insn->is_ea.ea_regnum & 7);
+ } else if (flags & EA_ABS) {
+ printf("0x%08x\n", insn->is_ea.ea_absaddr);
+ } else if (flags & EA_PC_REL) {
+ printf("pc@(%d)\n", insn->is_ea.ea_offset);
+ } else if (flags & EA_IMMED) {
+ printf("#0x%08x%08x%08x\n",
+ insn->is_ea.ea_immed[0], insn->is_ea.ea_immed[1],
+ insn->is_ea.ea_immed[2]);
+ } else {
+ printf("%c%d@\n", regname, insn->is_ea.ea_regnum & 7);
}
- fpu_load_ea(frame, insn, &insn->is_ea0, (char*)buf);
+#endif
+ fpu_load_ea(frame, insn, &insn->is_ea, (char*)buf);
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: src = %08x%08x%08x, siz = %d\n",
- buf[0], buf[1], buf[2], insn->is_datasize);
- }
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: src = %08x%08x%08x, siz = %d\n",
+ buf[0], buf[1], buf[2], insn->is_datasize);
+#endif
if (format == FTYPE_LNG) {
/* nothing */
scale = buf[0];
@@ -307,7 +307,7 @@
break;
default:
#ifdef DEBUG
- panic(" fpu_emul_fscale: invalid fp class");
+ panic("fpu_emul_fscale: invalid fp class");
#endif
break;
}
@@ -324,10 +324,10 @@
/* update fpsr according to the result of operation */
fe->fe_fpframe->fpf_fpsr = fe->fe_fpsr = fpsr;
- if (fpu_debug_level & DL_FSCALE) {
- printf(" fpu_emul_fscale: FPSR = %08x, FPCR = %08x\n",
- fe->fe_fpsr, fe->fe_fpcr);
- }
+#if DEBUG_FPE
+ printf("fpu_emul_fscale: FPSR = %08x, FPCR = %08x\n",
+ fe->fe_fpsr, fe->fe_fpcr);
+#endif
return (fpsr & fe->fe_fpcr & FPSR_EXCP) ? SIGFPE : sig;
}
Home |
Main Index |
Thread Index |
Old Index