🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #185

Re: 486 FP problem

#185
From: John Hauser
Date: Thu, 06 Aug 1992 16:10
60 lines
2609 bytes
In article <JINX.92Aug4220859@rolex.ai.mit.edu> jinx@zurich.ai.mit.edu writes:
>The i486 Microprocessor Programmer's Reference Manual (Osborne
>McGraw-Hill's version) lists the following line in the description of
>the FDIV instruction (pg. 26-87):
>
>DC F8 + i	FDIV ST(i),ST	73	70	Replace ST(i) with ST : ST(i)
>
>and the following line in the description of the FDIVR instruction (pg. 26-89):
>
>DC F0 + i	FDIVR ST(i),ST	73	70	Divide ST(i) by ST
>
>Where the columns mean:
>
>Opcode		Instruction	Clocks	Clocks*	Description
>
>I have reason to believe that the opcodes in these two instructions
>are swapped, that is, "DC F8+i" corresponds to FDIVR and "DC F0+i"
>corresponds to FDIV.
>
>Can anyone confirm this?  

Not me.  However, I can tell you that the various tables and charts of the
1989 edition of Intel's 387 DX User's Manual give at least three different
contradictory opcode assignments for the set of instructions FDIV ST,ST(i),
FDIV ST(i),ST, FDIVR ST,ST(i), and FDIVR ST(i),ST.  I suspect that not all
of these tables are correct.

From the available info, my engineer's intuition would suggest the following:

	D8 F0+i		ST := ST / ST(i)
	D8 F8+i		ST := ST(i) / ST
	DC F0+i		ST(i) := ST / ST(i)
	DC F8+i		ST(i) := ST(i) / ST

I would guess the confusion started with the mnemonics.  A *logical*
assignment would have given the above the names (in order)

			DIV ST,ST(i)
			DIVR ST,ST(i)
			DIVR ST(i),ST
			DIV ST(i),ST

with the destination always being the first argument.  But at some point, it
seems, someone thought they were supposed to be

			DIV ST,ST(i)
			DIVR ST,ST(i)
			DIV ST(i),ST
			DIVR ST(i),ST

where DIV means the division is ST / ST(i), and DIVR means it is ST(i) / ST.
Hence the confusion in opcodes.  Mind you, I wasn't there; I simply offer a
plausible explanation.

Would anyone like to comment on what the current actual usage in assemblers
is??

----------------------------------------------------------------------------
Boycott redwood.  Boycott Louisiana-Pacific.  Keep the forests.  YYYYYYYYYYY
John Hauser---jhauser@cs.berkeley.edu  YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Technical Details
Message-ID: <15ritqINNbqv@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!pine.CS.Berkeley.EDU!jhauser
References: <JINX.92Aug4220859@rolex.ai.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!pine.CS.Berkeley.EDU!jhauser
From: jhauser@pine.CS.Berkeley.EDU (John Hauser)
Newsgroups: comp.sys.intel
Subject: Re: 486 FP problem
Date: 6 Aug 1992 16:10:34 GMT
Organization: University of California at Berkeley
Lines: 60
Distribution: usa
Message-ID: <15ritqINNbqv@agate.berkeley.edu>
References: <JINX.92Aug4220859@rolex.ai.mit.edu>
NNTP-Posting-Host: pine.cs.berkeley.edu