🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.misc
Article #407

Re: 386 vs 387 integer divide performance

#407
From: Jihad 'R US
Date: Wed, 10 Oct 1990 23:41
49 lines
2366 bytes
   From: jde@Unify.Com (Jeff Evarts)
  
   Netters,
	   I have a question, err one question in two parts.

	   Suppose I have some 32  bit INTEGER division to do, and I am
	   running on a system with a 386 with a 387. A quick look at my
	   manuals seems to indicate the following timings:

		   386: 46-49 cycles
		   387: 88-127 cycles

	   1. Am I missing something obvious, or wouldn`t the 386 be the
	      faster of the two? I _understand_ that the 387 is an FP machine,
	      but I had thought that it might have some nifty tricks or
	      optimized hardware to do the job in less time.


The 386 is faster for integer division, because it does not have to deal
with any of the floating point details.  Also, cycle counts also depend
on the operands of you rdivisions.  Dividing 32 bits by 16 takes 27-30
64 by 32 takes 43-46, 16 by 8 takes 19-22.  on the floating point
side, stack(0) by integer takes 120-127 cycles on the 387.  The integer 
chip wins for integer division.   Also, floating point division does not
give integral answers, so one must convert back to integers. (79-93)

	   2. If I have got it right, and the 386 is the faster engine, does
	      this change for a 486?

If my memory serves me, the 486 can be faster for some operations using
floats, but the general rule is to use the instruction type ( int,
float) that fits the problem best.  

( I got this information out of the book Programming the 80386, by
John Crawford and Patric Gelsinger.  Useful book, includes _detailed_ 
timing specs, and tons of examples, etc)

   Thanks in Advance,

   -Jeff Evarts
   --jde@unify.COM
   ---{sequent|pyramid|csusac}!unify!jde
   #include <std.disclaimer>

Hope this helps,
Rob.
6600m00n@ucsbuxa.ucsb.edu
( and remember, shld, and lea are your assembly friends!)
Technical Details
Message-ID: <6544@hub.ucsb.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!hub.ucsb.edu!6600m00n
References: <qbc13ys@Unify.Com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!hub.ucsb.edu!6600m00n
From: 6600m00n@ucsbuxa.ucsb.edu (Jihad 'R US)
Newsgroups: comp.sys.misc,comp.sys.intel
Subject: Re: 386 vs 387 integer divide performance
Message-ID: <6544@hub.ucsb.edu>
Date: 10 Oct 90 23:41:31 GMT
References: <qbc13ys@Unify.Com>
Sender: news@hub.ucsb.edu
Reply-To: 6600m00n@ucsbuxa.ucsb.edu
Distribution: usa
Organization: Ghostwheel Redevelopment Agency
Lines: 49
In-reply-to: jde@Unify.Com's message of 9 Oct 90 21:28:50 GMT