From 517801475eb4c3f11f3f10542763bbdac124d710 Mon Sep 17 00:00:00 2001 From: niklas Date: Thu, 9 May 1996 22:20:42 +0000 Subject: [PATCH] From NetBSD: Update for -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-uninitialized. Bring back Step9 and fix an oversight from Ken Nakata --- sys/arch/m68k/fpe/fpu_add.c | 4 ++- sys/arch/m68k/fpe/fpu_calcea.c | 55 +++++++++++++++++---------------- sys/arch/m68k/fpe/fpu_emulate.c | 26 +++++++++------- sys/arch/m68k/fpe/fpu_emulate.h | 8 ++++- sys/arch/m68k/fpe/fpu_explode.c | 4 ++- sys/arch/m68k/fpe/fpu_fmovecr.c | 52 +++++++++++++++---------------- sys/arch/m68k/fpe/fpu_fscale.c | 4 ++- sys/arch/m68k/fpe/fpu_fstore.c | 8 ++--- sys/arch/m68k/fpe/fpu_implode.c | 6 ++-- sys/arch/m68k/fpe/fpu_log.c | 4 ++- sys/arch/m68k/fpe/fpu_rem.c | 17 +++++----- sys/arch/m68k/fpe/fpu_subr.c | 4 ++- 12 files changed, 107 insertions(+), 85 deletions(-) diff --git a/sys/arch/m68k/fpe/fpu_add.c b/sys/arch/m68k/fpe/fpu_add.c index 48e332b3dcd..33c6df85c2e 100644 --- a/sys/arch/m68k/fpe/fpu_add.c +++ b/sys/arch/m68k/fpe/fpu_add.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_add.c,v 1.1 1995/11/03 04:46:58 briggs Exp $ */ +/* $OpenBSD: fpu_add.c,v 1.2 1996/05/09 22:20:42 niklas Exp $ */ +/* $NetBSD: fpu_add.c,v 1.2 1996/04/30 11:52:09 briggs Exp $ */ /* * Copyright (c) 1992, 1993 @@ -51,6 +52,7 @@ */ #include +#include #include diff --git a/sys/arch/m68k/fpe/fpu_calcea.c b/sys/arch/m68k/fpe/fpu_calcea.c index e97d4dbecbe..b8a29000959 100644 --- a/sys/arch/m68k/fpe/fpu_calcea.c +++ b/sys/arch/m68k/fpe/fpu_calcea.c @@ -1,5 +1,5 @@ -/* $OpenBSD: fpu_calcea.c,v 1.2 1996/02/27 11:03:17 niklas Exp $ */ -/* $NetBSD: fpu_calcea.c,v 1.3 1996/02/04 02:17:38 briggs Exp $ */ +/* $OpenBSD: fpu_calcea.c,v 1.3 1996/05/09 22:20:43 niklas Exp $ */ +/* $NetBSD: fpu_calcea.c,v 1.4 1996/04/30 11:52:11 briggs Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -34,6 +34,7 @@ #include #include +#include #include #include "fpu_emulate.h" @@ -49,6 +50,8 @@ static int fetch_disp __P((struct frame *frame, struct instruction *insn, int size, int *res)); static int calc_ea __P((struct insn_ea *ea, char *ptr, char **eaddr)); +int fusword __P((void *)); + /* * Helper routines for dealing with "effective address" values. */ @@ -64,7 +67,7 @@ fpu_decode_ea(frame, insn, ea, modreg) struct insn_ea *ea; int modreg; { - int data, sig; + int sig; #ifdef DEBUG if (insn->is_datasize < 0) { @@ -189,12 +192,12 @@ decode_ea6(frame, insn, ea, modreg) struct insn_ea *ea; int modreg; { - int word, extword, idx; + int extword, idx; int basedisp, outerdisp; int bd_size, od_size; int sig; - extword = fusword(frame->f_pc + insn->is_advance); + extword = fusword((void *) (frame->f_pc + insn->is_advance)); if (extword < 0) { return SIGSEGV; } @@ -292,7 +295,7 @@ fpu_load_ea(frame, insn, ea, dst) int *reg; char *src; int len, step; - int data, word, sig; + int sig; #ifdef DIAGNOSTIC if (ea->ea_regnum & ~0xF) { @@ -301,7 +304,7 @@ fpu_load_ea(frame, insn, ea, dst) #endif if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: frame at %08x\n", frame); + printf(" load_ea: frame at %p\n", frame); } /* The dst is always int or larger. */ len = insn->is_datasize; @@ -332,7 +335,7 @@ fpu_load_ea(frame, insn, ea, dst) } } if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: src 0x%08x\n", src); + printf(" load_ea: src %p\n", src); } bcopy(src, dst, len); } else if (ea->ea_flags & EA_IMMED) { @@ -364,7 +367,7 @@ fpu_load_ea(frame, insn, ea, dst) extention word from the opcode */ src = (char *)frame->f_pc + 4; if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: pc relative pc+4 = 0x%08x\n", src); + printf(" load_ea: pc relative pc+4 = %p\n", src); } } else /* not PC relative */ { if (fpu_debug_level & DL_LOADEA) { @@ -385,7 +388,7 @@ fpu_load_ea(frame, insn, ea, dst) /* Grab the register contents. */ src = (char *)*reg; if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: reg indirect reg = 0x%08x\n", src); + printf(" load_ea: reg indirect reg = %p\n", src); } } @@ -430,7 +433,7 @@ fpu_store_ea(frame, insn, ea, src) int *reg; char *dst; int len, step; - int data, word, sig; + int sig; #ifdef DIAGNOSTIC if (ea->ea_regnum & ~0xF) { @@ -447,7 +450,7 @@ fpu_store_ea(frame, insn, ea, src) } if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: frame at %08x\n", frame); + printf(" store_ea: frame at %p\n", frame); } /* The src is always int or larger. */ len = insn->is_datasize; @@ -485,7 +488,7 @@ fpu_store_ea(frame, insn, ea, src) } } if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: dst 0x%08x\n", dst); + printf(" store_ea: dst %p\n", dst); } bcopy(src, dst, len); } else /* One of MANY indirect forms... */ { @@ -511,7 +514,7 @@ fpu_store_ea(frame, insn, ea, src) return sig; if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: dst addr=0x%08x+%d\n", dst, ea->ea_tdisp); + printf(" store_ea: dst addr=%p+%d\n", dst, ea->ea_tdisp); } copyout(src, dst + ea->ea_tdisp, len); @@ -544,7 +547,7 @@ fetch_immed(frame, insn, dst) ext_bytes = insn->is_datasize; if (0 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } @@ -565,7 +568,7 @@ fetch_immed(frame, insn, dst) dst[0] = data; } if (2 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } @@ -574,12 +577,12 @@ fetch_immed(frame, insn, dst) dst[0] |= data; } if (4 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } dst[1] = data << 16; - data = fusword(frame->f_pc + insn->is_advance + 2); + data = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (data < 0) { return SIGSEGV; } @@ -587,12 +590,12 @@ fetch_immed(frame, insn, dst) dst[1] |= data; } if (8 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } dst[2] = data << 16; - data = fusword(frame->f_pc + insn->is_advance + 2); + data = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (data < 0) { return SIGSEGV; } @@ -615,7 +618,7 @@ fetch_disp(frame, insn, size, res) int disp, word; if (size == 1) { - word = fusword(frame->f_pc + insn->is_advance); + word = fusword((void *) (frame->f_pc + insn->is_advance)); if (word < 0) { return SIGSEGV; } @@ -626,12 +629,12 @@ fetch_disp(frame, insn, size, res) } insn->is_advance += 2; } else if (size == 2) { - word = fusword(frame->f_pc + insn->is_advance); + word = fusword((void *) (frame->f_pc + insn->is_advance)); if (word < 0) { return SIGSEGV; } disp = word << 16; - word = fusword(frame->f_pc + insn->is_advance + 2); + word = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (word < 0) { return SIGSEGV; } @@ -656,10 +659,10 @@ calc_ea(ea, ptr, eaddr) char *ptr; /* base address (usually a register content) */ char **eaddr; /* pointer to result pointer */ { - int data, word, sig; + int data, word; if (fpu_debug_level & DL_EA) { - printf(" calc_ea: reg indirect (reg) = 0x%08x\n", ptr); + printf(" calc_ea: reg indirect (reg) = %p\n", ptr); } if (ea->ea_flags & EA_OFFSET) { @@ -684,7 +687,7 @@ calc_ea(ea, ptr, eaddr) if (fpu_debug_level & DL_EA) { printf(" calc_ea: mem indir mode: basedisp=%08x, outerdisp=%08x\n", ea->ea_basedisp, ea->ea_outerdisp); - printf(" calc_ea: addr fetched from 0x%08x\n", ptr); + printf(" calc_ea: addr fetched from %p\n", ptr); } /* memory indirect modes */ word = fusword(ptr); diff --git a/sys/arch/m68k/fpe/fpu_emulate.c b/sys/arch/m68k/fpe/fpu_emulate.c index ed86855d09a..df0fe6996d8 100644 --- a/sys/arch/m68k/fpe/fpu_emulate.c +++ b/sys/arch/m68k/fpe/fpu_emulate.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_emulate.c,v 1.4 1995/11/05 00:35:17 briggs Exp $ */ +/* $OpenBSD: fpu_emulate.c,v 1.3 1996/05/09 22:20:43 niklas Exp $ */ +/* $NetBSD: fpu_emulate.c,v 1.5 1996/04/30 11:52:13 briggs Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -38,6 +39,7 @@ #include #include +#include #include #include "fpu_emulate.h" @@ -50,6 +52,8 @@ static int fpu_emul_brcc __P((struct fpemu *fe, struct instruction *insn)); static int test_cc __P((struct fpemu *fe, int pred)); static struct fpn *fpu_cmp __P((struct fpemu *fe)); +int fusword __P((void *)); + #if !defined(DL_DEFAULT) # if defined(DEBUG_WITH_FPU) # define DL_DEFAULT DL_ALL @@ -59,7 +63,9 @@ static struct fpn *fpu_cmp __P((struct fpemu *fe)); #endif int fpu_debug_level; +#if DEBUG static int global_debug_level = DL_DEFAULT; +#endif #define DUMP_INSN(insn) \ if (fpu_debug_level & DL_DUMPINSN) { \ @@ -86,8 +92,6 @@ fpu_emulate(frame, fpf) static struct instruction insn; static struct fpemu fe; int word, optype, sig; - int i; - u_int *pt; #ifdef DEBUG /* initialize insn.is_datasize to tell it is *not* initialized */ @@ -115,7 +119,7 @@ fpu_emulate(frame, fpf) printf("ENTERING fpu_emulate: FPSR=%08x, FPCR=%08x\n", fe.fe_fpsr, fe.fe_fpcr); } - word = fusword(frame->f_pc); + word = fusword((void *) (frame->f_pc)); if (word < 0) { #ifdef DEBUG printf(" fpu_emulate: fault reading opcode\n"); @@ -146,7 +150,7 @@ fpu_emulate(frame, fpf) insn.is_opcode = word; optype = (word & 0x01C0); - word = fusword(frame->f_pc + 2); + word = fusword((void *) (frame->f_pc + 2)); if (word < 0) { #ifdef DEBUG printf(" fpu_emulate: fault reading word1\n"); @@ -344,8 +348,8 @@ fpu_emul_fmovmcr(fe, insn) { struct frame *frame = fe->fe_frame; struct fpframe *fpf = fe->fe_fpframe; - int word1, sig; - int reglist, regmask, regnum; + int sig; + int reglist; int fpu_to_mem; /* move to/from control registers */ @@ -1031,7 +1035,6 @@ fpu_emul_type1(fe, insn) struct instruction *insn; { struct frame *frame = fe->fe_frame; - struct fpframe *fpf = fe->fe_fpframe; int advance, sig, branch, displ; branch = test_cc(fe, insn->is_word1); @@ -1050,7 +1053,7 @@ fpu_emul_type1(fe, insn) u_int16_t count = frame->f_regs[insn->is_opcode & 7]; if (count-- != 0) { - displ = fusword(frame->f_pc + insn->is_advance); + displ = fusword((void *) (frame->f_pc + insn->is_advance)); if (displ < 0) { #ifdef DEBUG printf(" fpu_emul_type1: fault reading displacement\n"); @@ -1130,9 +1133,8 @@ fpu_emul_brcc(fe, insn) struct instruction *insn; { struct frame *frame = fe->fe_frame; - struct fpframe *fpf = fe->fe_fpframe; int displ, word2; - int sig, advance; + int sig; /* * Get branch displacement. @@ -1141,7 +1143,7 @@ fpu_emul_brcc(fe, insn) displ = insn->is_word1; if (insn->is_opcode & 0x40) { - word2 = fusword(frame->f_pc + insn->is_advance); + word2 = fusword((void *) (frame->f_pc + insn->is_advance)); if (word2 < 0) { #ifdef DEBUG printf(" fpu_emul_brcc: fault reading word2\n"); diff --git a/sys/arch/m68k/fpe/fpu_emulate.h b/sys/arch/m68k/fpe/fpu_emulate.h index 7909972302d..e12ad5d09ea 100644 --- a/sys/arch/m68k/fpe/fpu_emulate.h +++ b/sys/arch/m68k/fpe/fpu_emulate.h @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_emulate.h,v 1.3 1996/01/12 04:23:54 briggs Exp $ */ +/* $OpenBSD: fpu_emulate.h,v 1.3 1996/05/09 22:20:44 niklas Exp $ */ +/* $NetBSD: fpu_emulate.h,v 1.4 1996/04/30 11:52:14 briggs Exp $ */ /* * Copyright (c) 1995 Gordon Ross @@ -285,6 +286,8 @@ int fpu_emul_fscale __P((struct fpemu *fe, struct instruction *insn)); */ #include "fpu_arith_proto.h" +int fpu_emulate __P((struct frame *frame, struct fpframe *fpf)); + /* * "helper" functions */ @@ -302,6 +305,9 @@ int fpu_load_ea __P((struct frame *frame, struct instruction *insn, int fpu_store_ea __P((struct frame *frame, struct instruction *insn, struct insn_ea *ea, char *src)); +/* fpu_subr.c */ +void fpu_norm __P((register struct fpn *fp)); + /* declarations for debugging */ extern int fpu_debug_level; diff --git a/sys/arch/m68k/fpe/fpu_explode.c b/sys/arch/m68k/fpe/fpu_explode.c index c5c8bd2c9d0..dcbf57776fb 100644 --- a/sys/arch/m68k/fpe/fpu_explode.c +++ b/sys/arch/m68k/fpe/fpu_explode.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_explode.c,v 1.1 1995/11/03 04:47:07 briggs Exp $ */ +/* $OpenBSD: fpu_explode.c,v 1.2 1996/05/09 22:20:45 niklas Exp $ */ +/* $NetBSD: fpu_explode.c,v 1.2 1996/04/30 11:52:18 briggs Exp $ */ /* * Copyright (c) 1992, 1993 @@ -50,6 +51,7 @@ */ #include +#include #include "ieee.h" #include diff --git a/sys/arch/m68k/fpe/fpu_fmovecr.c b/sys/arch/m68k/fpe/fpu_fmovecr.c index f68b3964dc2..c3ebe5cdd06 100644 --- a/sys/arch/m68k/fpe/fpu_fmovecr.c +++ b/sys/arch/m68k/fpe/fpu_fmovecr.c @@ -1,5 +1,5 @@ -/* $OpenBSD: fpu_fmovecr.c,v 1.2 1996/02/27 11:03:20 niklas Exp $ */ -/* $NetBSD: fpu_fmovecr.c,v 1.3 1996/02/04 02:17:42 briggs Exp $ */ +/* $OpenBSD: fpu_fmovecr.c,v 1.3 1996/05/09 22:20:45 niklas Exp $ */ +/* $NetBSD: fpu_fmovecr.c,v 1.4 1996/04/30 11:52:22 briggs Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -33,34 +33,35 @@ */ #include +#include #include #include "fpu_emulate.h" static struct fpn constrom[] = { /* fp_class, fp_sign, fp_exp, fp_sticky, fp_mant[0] ... [3] */ - { FPC_NUM, 0, 1, 0, 0x6487e, 0xd5110b46, 0x11a80000, 0x0 }, - { FPC_NUM, 0, -2, 0, 0x4d104, 0xd427de7f, 0xbcc00000, 0x0 }, - { FPC_NUM, 0, 1, 0, 0x56fc2, 0xa2c515da, 0x54d00000, 0x0 }, - { FPC_NUM, 0, 0, 0, 0x5c551, 0xd94ae0bf, 0x85e00000, 0x0 }, - { FPC_NUM, 0, -2, 0, 0x6f2de, 0xc549b943, 0x8ca80000, 0x0 }, - { FPC_ZERO, 0, 0, 0, 0x0, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, -1, 0, 0x58b90, 0xbfbe8e7b, 0xcd600000, 0x0 }, - { FPC_NUM, 0, 1, 0, 0x49aec, 0x6eed5545, 0x60b80000, 0x0 }, - { FPC_NUM, 0, 0, 0, 0x40000, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, 3, 0, 0x50000, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, 6, 0, 0x64000, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, 13, 0, 0x4e200, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, 26, 0, 0x5f5e1, 0x0, 0x0, 0x0 }, - { FPC_NUM, 0, 53, 0, 0x470de, 0x4df82000, 0x0, 0x0 }, - { FPC_NUM, 0, 106, 0, 0x4ee2d, 0x6d415b85, 0xacf00000, 0x0 }, - { FPC_NUM, 0, 212, 0, 0x613c0, 0xfa4ffe7d, 0x36a80000, 0x0 }, - { FPC_NUM, 0, 425, 0, 0x49dd2, 0x3e4c074c, 0x67000000, 0x0 }, - { FPC_NUM, 0, 850, 0, 0x553f7, 0x5fdcefce, 0xf4700000, 0x0 }, - { FPC_NUM, 0, 1700, 0, 0x718cd, 0x5753074, 0x8e380000, 0x0 }, - { FPC_NUM, 0, 3401, 0, 0x64bb3, 0xac340ba8, 0x60b80000, 0x0 }, - { FPC_NUM, 0, 6803, 0, 0x4f459, 0xdaee29ea, 0xef280000, 0x0 }, - { FPC_NUM, 0, 13606, 0, 0x62302, 0x90145104, 0xbcd80000, 0x0 }, + { FPC_NUM, 0, 1, 0, { 0x6487e, 0xd5110b46, 0x11a80000, 0x0 } }, + { FPC_NUM, 0, -2, 0, { 0x4d104, 0xd427de7f, 0xbcc00000, 0x0 } }, + { FPC_NUM, 0, 1, 0, { 0x56fc2, 0xa2c515da, 0x54d00000, 0x0 } }, + { FPC_NUM, 0, 0, 0, { 0x5c551, 0xd94ae0bf, 0x85e00000, 0x0 } }, + { FPC_NUM, 0, -2, 0, { 0x6f2de, 0xc549b943, 0x8ca80000, 0x0 } }, + { FPC_ZERO, 0, 0, 0, { 0x0, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, -1, 0, { 0x58b90, 0xbfbe8e7b, 0xcd600000, 0x0 } }, + { FPC_NUM, 0, 1, 0, { 0x49aec, 0x6eed5545, 0x60b80000, 0x0 } }, + { FPC_NUM, 0, 0, 0, { 0x40000, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, 3, 0, { 0x50000, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, 6, 0, { 0x64000, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, 13, 0, { 0x4e200, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, 26, 0, { 0x5f5e1, 0x0, 0x0, 0x0 } }, + { FPC_NUM, 0, 53, 0, { 0x470de, 0x4df82000, 0x0, 0x0 } }, + { FPC_NUM, 0, 106, 0, { 0x4ee2d, 0x6d415b85, 0xacf00000, 0x0 } }, + { FPC_NUM, 0, 212, 0, { 0x613c0, 0xfa4ffe7d, 0x36a80000, 0x0 } }, + { FPC_NUM, 0, 425, 0, { 0x49dd2, 0x3e4c074c, 0x67000000, 0x0 } }, + { FPC_NUM, 0, 850, 0, { 0x553f7, 0x5fdcefce, 0xf4700000, 0x0 } }, + { FPC_NUM, 0, 1700, 0, { 0x718cd, 0x5753074, 0x8e380000, 0x0 } }, + { FPC_NUM, 0, 3401, 0, { 0x64bb3, 0xac340ba8, 0x60b80000, 0x0 } }, + { FPC_NUM, 0, 6803, 0, { 0x4f459, 0xdaee29ea, 0xef280000, 0x0 } }, + { FPC_NUM, 0, 13606, 0, { 0x62302, 0x90145104, 0xbcd80000, 0x0 } }, }; struct fpn * @@ -69,7 +70,6 @@ fpu_const(fp, offset) u_int offset; { struct fpn *r; - int i; #ifdef DEBUG if (fp == NULL) { @@ -97,7 +97,7 @@ fpu_emul_fmovecr(fe, insn) struct fpemu *fe; struct instruction *insn; { - int dstreg, offset, sig; + int dstreg, offset; u_int *fpreg; dstreg = (insn->is_word1 >> 7) & 0x7; diff --git a/sys/arch/m68k/fpe/fpu_fscale.c b/sys/arch/m68k/fpe/fpu_fscale.c index ad98d165345..328ae993522 100644 --- a/sys/arch/m68k/fpe/fpu_fscale.c +++ b/sys/arch/m68k/fpe/fpu_fscale.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_fscale.c,v 1.2 1995/11/05 00:35:25 briggs Exp $ */ +/* $OpenBSD: fpu_fscale.c,v 1.2 1996/05/09 22:20:46 niklas Exp $ */ +/* $NetBSD: fpu_fscale.c,v 1.3 1996/04/30 11:52:25 briggs Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -39,6 +40,7 @@ #include #include +#include #include #include "fpu_emulate.h" diff --git a/sys/arch/m68k/fpe/fpu_fstore.c b/sys/arch/m68k/fpe/fpu_fstore.c index 34de45f10fc..bf39a7973ca 100644 --- a/sys/arch/m68k/fpe/fpu_fstore.c +++ b/sys/arch/m68k/fpe/fpu_fstore.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_fstore.c,v 1.2 1995/11/05 00:35:29 briggs Exp $ */ +/* $OpenBSD: fpu_fstore.c,v 1.2 1996/05/09 22:20:46 niklas Exp $ */ +/* $NetBSD: fpu_fstore.c,v 1.3 1996/04/30 11:52:27 briggs Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -27,6 +28,7 @@ #include #include +#include #include #include "fpu_emulate.h" @@ -48,11 +50,9 @@ fpu_emul_fstore(fe, insn) int regnum; int format; u_int buf[3]; - u_int flags; - char regname; if (fpu_debug_level & DL_FSTORE) { - printf(" fpu_emul_fstore: frame at %08x fpframe at %08x\n", + printf(" fpu_emul_fstore: frame at %p fpframe at %p\n", frame, fe->fe_fpframe); } diff --git a/sys/arch/m68k/fpe/fpu_implode.c b/sys/arch/m68k/fpe/fpu_implode.c index 2e47ca40494..dd1ab6fec7a 100644 --- a/sys/arch/m68k/fpe/fpu_implode.c +++ b/sys/arch/m68k/fpe/fpu_implode.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_implode.c,v 1.1 1995/11/03 04:47:12 briggs Exp $ */ +/* $OpenBSD: fpu_implode.c,v 1.2 1996/05/09 22:20:47 niklas Exp $ */ +/* $NetBSD: fpu_implode.c,v 1.2 1996/04/30 11:52:30 briggs Exp $ */ /* * Copyright (c) 1992, 1993 @@ -50,6 +51,7 @@ */ #include +#include #include "ieee.h" #include @@ -79,7 +81,7 @@ int round(register struct fpemu *fe, register struct fpn *fp) { register u_int m0, m1, m2, m3; - register int gr, s, ret; + register int gr, s; m0 = fp->fp_mant[0]; m1 = fp->fp_mant[1]; diff --git a/sys/arch/m68k/fpe/fpu_log.c b/sys/arch/m68k/fpe/fpu_log.c index 19788c39e97..d6a64e67433 100644 --- a/sys/arch/m68k/fpe/fpu_log.c +++ b/sys/arch/m68k/fpe/fpu_log.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_log.c,v 1.2 1995/11/05 00:35:31 briggs Exp $ */ +/* $OpenBSD: fpu_log.c,v 1.2 1996/05/09 22:20:47 niklas Exp $ */ +/* $NetBSD: fpu_log.c,v 1.3 1996/04/30 11:52:33 briggs Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -32,6 +33,7 @@ */ #include +#include #include "fpu_emulate.h" diff --git a/sys/arch/m68k/fpe/fpu_rem.c b/sys/arch/m68k/fpe/fpu_rem.c index ddf24ec5725..0b201352e47 100644 --- a/sys/arch/m68k/fpe/fpu_rem.c +++ b/sys/arch/m68k/fpe/fpu_rem.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_rem.c,v 1.1 1995/11/03 04:47:17 briggs Exp $ */ +/* $OpenBSD: fpu_rem.c,v 1.2 1996/05/09 22:20:48 niklas Exp $ */ +/* $NetBSD: fpu_rem.c,v 1.3 1996/04/30 12:02:54 briggs Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -92,7 +93,7 @@ __fpu_modrem(fe, modrem) static struct fpn X, Y; struct fpn *x, *y, *r; u_int signX, signY, signQ; - int i, j, k, l, q; + int j, k, l, q; int Last_Subtract; CPYFPN(&X, &fe->fe_f1); @@ -115,9 +116,7 @@ __fpu_modrem(fe, modrem) l = x->fp_exp - y->fp_exp; k = 0; q = 0; - if (l < 0) { - goto Step4; - } else { + if (l >= 0) { CPYFPN(r, x); r->fp_exp -= l; j = l; @@ -153,7 +152,7 @@ __fpu_modrem(fe, modrem) r->fp_exp++; } /* Step 9 */ - + goto Step9; } Step4: Last_Subtract = 0; @@ -165,9 +164,9 @@ __fpu_modrem(fe, modrem) */ /* Step 5.1 */ if (r->fp_exp + 1 < y->fp_exp || - r->fp_exp + 1 == y->fp_exp && - (r->fp_mant[0] < y->fp_mant[0] || r->fp_mant[1] < y->fp_mant[1] || - r->fp_mant[2] < y->fp_mant[3] || r->fp_mant[4] < y->fp_mant[4])) + (r->fp_exp + 1 == y->fp_exp && + (r->fp_mant[0] < y->fp_mant[0] || r->fp_mant[1] < y->fp_mant[1] || + r->fp_mant[2] < y->fp_mant[3] || r->fp_mant[4] < y->fp_mant[4]))) /* if r < y/2 */ goto Step6; /* Step 5.2 */ diff --git a/sys/arch/m68k/fpe/fpu_subr.c b/sys/arch/m68k/fpe/fpu_subr.c index fed1294ce2f..0f62d770d9d 100644 --- a/sys/arch/m68k/fpe/fpu_subr.c +++ b/sys/arch/m68k/fpe/fpu_subr.c @@ -1,4 +1,5 @@ -/* $NetBSD: fpu_subr.c,v 1.1 1995/11/03 04:47:19 briggs Exp $ */ +/* $OpenBSD: fpu_subr.c,v 1.2 1996/05/09 22:20:48 niklas Exp $ */ +/* $NetBSD: fpu_subr.c,v 1.2 1996/04/30 11:52:38 briggs Exp $ */ /* * Copyright (c) 1992, 1993 @@ -49,6 +50,7 @@ */ #include +#include #include -- 2.20.1