Subject: Re: port-i386/6986: FPU emulation problems
To: Frank van der Linden <frank@wins.uva.nl>
From: Dave Huang <khym@bga.com>
List: port-i386
Date: 04/03/1999 20:36:34
On Mon, 29 Mar 1999, Frank van der Linden wrote:
> Thanks. If Dave verifies that it works, I'll check it in, since
> fixing the emulation is not going to happen soon (I am not aware
> of anyone doing it).

The patch fixes the
  math_emulate: 0xd9fa not implemented
  Illegal instruction

error from ping, but the original problem with fnstsw is still there...
This hack makes gas output "df e0" for "fnstsw %ax" rather than "66 df
e0". There's probably a better way to do it though:

--- /usr/src/gnu/dist/include/opcode/i386.h	Wed Feb  3 06:14:51 1999
+++ i386.h	Fri Feb 12 17:03:03 1999
@@ -708,10 +708,10 @@
 {"fldcw",  1,	0xd9, 5, Modrm,		{ Mem, 0, 0} },
 {"fnstcw", 1,	0xd9, 7, Modrm,		{ Mem, 0, 0} },
 {"fstcw",  1,	0xd9, 7, FWait|Modrm,	{ Mem, 0, 0} },
-{"fnstsw", 1, 0xdfe0, _, NoModrm,	{ Acc, 0, 0} },
+{"fnstsw", 1, 0xdfe0, _, Data32|NoModrm, { Acc, 0, 0} },
 {"fnstsw", 1,	0xdd, 7, Modrm,		{ Mem, 0, 0} },
 {"fnstsw", 0, 0xdfe0, _, NoModrm,	{ 0, 0, 0} },
-{"fstsw",  1, 0xdfe0, _, FWait|NoModrm,	{ Acc, 0, 0} },
+{"fstsw",  1, 0xdfe0, _, Data32|FWait|NoModrm, { Acc, 0, 0} },
 {"fstsw",  1,	0xdd, 7, FWait|Modrm,	{ Mem, 0, 0} },
 {"fstsw",  0, 0xdfe0, _, FWait|NoModrm,	{ 0, 0, 0} },
 {"fnclex", 0, 0xdbe2, _, NoModrm,	{ 0, 0, 0} },

-- 
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 23 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++