Commit Graph

39 Commits

Author SHA1 Message Date
thorpej
9a97f023a3 Fix undefined operation (= is not a sequence point). 2002-05-30 20:56:26 +00:00
tsutsui
6be7c15373 bcopy -> memcpy 2001-07-28 13:21:26 +00:00
toshii
4866f1a22b Fix typo. s/extention/extension/ 2001-07-05 08:38:24 +00:00
is
8931aeb7a9 Don't use the frames' provided EA yet; something is wrong. 2001-03-01 22:01:52 +00:00
chs
c5030d24f4 rename round() to fpu_round() to avoid a name conflict with
the "round" assembly function in FPSP when building with ELF.
2001-02-18 20:05:58 +00:00
chs
5f244b1055 conditionalize the ddb hook on DDB && DEBUG_FPE rather than DDB && DEBUG,
since that's the condition under which we include the header file that
allows it to compile.
2001-02-05 12:35:13 +00:00
is
b90c4c82d9 Make this actually sort-of-work for 68060 w. disabled FPU (tested), 68LC060,
and I suspect, 68LC040 and 68040V machines. Method used:

1. do NOT use the frames effective address at all
2. do NOT use the frames next instruction address, but
3. restore the "this instruction" pc into the pc field of the frame at the
   beginning of the emulation, if we got a frame format 4.

TODO:
A. find the bug in the usage of the frame EA, and revert to using it.
B. find the bug in the usage of the frames next instruction address, and
   consider whether it's worthwhile to use it.
C. make the emulation complete.... FEXP FETOM1, and the trigonometric functions
   are missing.
2001-01-05 19:54:30 +00:00
is
4e2cf3688b fpu_emulate.h:
the fmovecr constant table has the internal format
  of the constants. So, when changing the mantissa size by a
  non-multiple of 32 bits, we'd have to change this table, too. As
  all other code changes just chopped of the least significand
  32bit word of the mantissa, we correct the mantissa size instead
  to (115 - 32 == 83) bits.
fpu_fmovecr.c:
  put a safety belt in, to catch the next person who doesn't know this.
fpu_int.c:
  in one place, the reduction of the mantissa size was overlooked.
fpu_log.c:
  as the most significand 32bit word of the mantissa was changed back to the
  old format, change back the table indexing code, too.

This should fix PR 11045.
2000-09-22 19:47:58 +00:00
minoura
575a64a7af Correct comments. 2000-09-19 03:17:59 +00:00
minoura
d4d1b4cce4 Argument modreg of fpu_decode_ea() is actually an opecode.
That bug prevented awk(1) to work.
2000-06-13 12:28:13 +00:00
briggs
59422960ea PR 7220 from Ken Nakata:
I've fixed most (not all) m68k FPE bugs that give bogus
calculation results, esp. fsqrt instruction.  Also, the internal FP
representation has been reduced from 115-bit mantissa to 67-bit
mantissa which reduced the required mantissa operation roughly by one
fourth.  I've done an extensive (though not exhaustive - it's
impossible!) test on the internal routines by feeding them randomly
generated FP numbers, and found that the new code is more precise than
MC68040 FPU (it seems to have a rounding bug).

[ Only change was to keep fpu_calcea.c's name instead of renaming to
  fpu_ea.c in Ken's patch.  --akb ]
1999-05-30 20:17:48 +00:00
jonathan
466e784ee1 defopt DDB. 1998-07-04 22:18:13 +00:00
is
5c7d3c3f2c Back out last change, which was a thinko. 1997-11-03 11:10:41 +00:00
is
2ee51585ba Add ftwotox emulation, by using the fscale emulation routine (preload
destination register bit pattern with 1.0), which automatically provides
corner case handling.
Missing ftwotox emulation originally reported by Norman Mackenzie in PR 4237,
but he proposed a different implementation.
1997-11-02 22:02:46 +00:00
is
eb54c04b14 Don't forget to set the scale variable even if we dont need to sign-extend it.
From PR 4236 by Norman Mackenzie.
1997-10-09 19:19:01 +00:00
is
95370c73b8 Make us pass the full ieeefp except regression test.
XXX This is probably a horrible hack, and wrong. FPU signal handling needs
to be further evaluated.
1997-07-20 12:39:17 +00:00
is
f8ce8a3693 Fix my own PR port-m68k/3871, nee port-amiga/3871:
- don't erase FPSR exception bits _after_ doing most of the operations in
fpu_implode(), erase them before doing arith and store operations. This fixes
losing the DZ bit.
- create FPSR_OVFL and FPSR_UNFL bits in fpu_implode(). This showed up when
the first error was fixed.
XXX some more work needs to be done. E.g., creating OPERR together with
OVFL looks bogus, but I'm too tired know to re-check docs; and at least we
pass our own regression tests know.
1997-07-19 22:28:48 +00:00
veego
76371b8a9d include <m68k/db_machdep.h> to get the prototype for kdb_trap if DDB and
DEBUG are defined and add a cast for the second argument to the
kdb_trap call.
1997-07-17 06:27:08 +00:00
scottr
3ac126bc23 Work around another uninitialized variable warning 1996-12-18 05:44:31 +00:00
gwr
b8c288d184 Fix warnings. 1996-12-17 19:27:51 +00:00
is
e4d7a09a2a Bug fix for FSINCOS: wouldn't handle FPc == FP1 earlier. 1996-10-30 14:44:47 +00:00
scottr
fb42630e15 Eliminate fusword() prototype, as it's now in <sys/systm.h> 1996-10-16 06:27:05 +00:00
christos
9dc680b6a4 backout previous kprintf change 1996-10-13 03:19:10 +00:00
christos
60dd5ceebe printf -> kprintf, sprintf -> ksprintf 1996-10-11 00:06:28 +00:00
scottr
f8b0c86aa8 The 68LC040 generates a format 4 stack frame for floating point
exceptions, which puts the address of the instruction we faulted
on in a different location.  Copy it and handle as we normally would,
restoring the saved PC before returning.

The FPE should probably be reworked to take advantage of the 68LC040's
precalculated effective address, at some point.
1996-10-07 03:16:47 +00:00
scottr
d12b257695 Fix FMOVEM emulation; postincrement modes use different ordering than
predecrement modes, per 68K Programmer's Manual p. 5-88.  Pointed out
by Takeshi Nakayama <takeshi@sakabe.nuie.nagoya-u.ac.jp>, verified by me.
1996-10-04 18:07:24 +00:00
leo
be7b319e1b Fix "might be used uninitialized" warnings. 1996-05-15 07:31:55 +00:00
briggs
9cdce38dd0 Bring back Step9 and fix an oversight from Ken Nakata <kenn@remus.rutgers.edu> 1996-04-30 12:02:54 +00:00
briggs
41f393e6b8 Update for -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-uninitialized. 1996-04-30 11:52:09 +00:00
briggs
674ef2b6f2 sys/types.h -> sys/param.h and remove include of stddef.h. 1996-02-04 02:17:42 +00:00
briggs
592866ff5d sys/types.h -> sys/param.h and remove include of stddef.h. 1996-02-04 02:17:38 +00:00
briggs
4881a5d2a0 Remove explicit #define of DEBUG, per PR #1931. 1996-01-12 04:23:54 +00:00
briggs
f028be21e6 Update from Ken Nakata. 1995-11-05 04:23:00 +00:00
briggs
8b79bcb9e7 Fixes from Ken Nakata. Mainly renaming debug_level to fpu_debug_level. 1995-11-05 00:35:09 +00:00
briggs
cc272f90a1 Add in NetBSD id string. 1995-11-03 04:51:51 +00:00
briggs
526615e592 Add NetBSD id string and update instructions. 1995-11-03 04:48:22 +00:00
briggs
fc8793fb3d Still incomplete, but much more complete FPE from Ken Nakata
<kenn@remus.rutgers.edu>.  This emulator does not yet emulate
the following functions:
	FSINH, FETOXM1, FTANH, FATAN, FASIN, FATANH, FSIN, FTAN,
	FETOX, FTWOTOX, FTENTOX, FCOSH, FACOS, FCOS, FSINCOS
It is sufficient, however, to allow programs like df, w, and newfs,
to run to completion with correct results.
Portions of this code were based on the sparc fpe and on initial
work by gwr.
1995-11-03 04:46:55 +00:00
gwr
d0dba9b2d2 Add missing break in switch (not that it mattered 8^) 1995-03-10 01:43:05 +00:00
gwr
6ca3d5b258 First cut at an mc68881 emulator. Works only for fmovem right now. 1995-03-01 04:56:27 +00:00