Xref: utzoo rec.games.programmer:3433 comp.os.msdos.programmer:4707 comp.graphics:17299 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!rutgers!news.cs.indiana.edu!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: rec.games.programmer,comp.os.msdos.programmer,comp.graphics Subject: Re: Need hard core help doing some 3d optimizations Message-ID: <1991Apr17.133142.24149@maytag.waterloo.edu> Date: 17 Apr 91 13:31:42 GMT References: <1991Apr11.202429.29648@kuhub.cc.ukans.edu> <1991Apr13.154112.11345@dircon.co.uk> <1991Apr16.210819.17873@cs.fau.edu> Sender: news@maytag.waterloo.edu (News Owner) Organization: University of Waterloo Lines: 28 In article <1991Apr16.210819.17873@cs.fau.edu> conners@cs.fau.edu (Sean Conner) writes: > > So, okay, I have a MIPS system. No problem. But what about us poor >programmers who can only afford a 386/387 system? It is still faster to >use ints than floats, for two reasons: > > 1. On a 386, the longest a IDIV will take (this is with a memory > operand here) is 46 cycles. And the longest an IMUL will take > is 41 cycles. On the 387, the SHORTEST time it will take to > divide two reals is 91 cycles. A floating point multiply takes > about the same as the IMUL instruction (depends on addressing > modes, though). Just in case you're interested: the times for the 486 are IDIV 19-44 FDIV 73 IMUL 13-42 FMUL 11-16 So it looks as though floating point math would be a contender, even without a MIPS, as long as you avoided the divides. I don't know the algorithms you want to use, but very often the denominator in a series of divides stays the same for a long time, so you can replace it with a series of multiplies by the reciprocal. Duncan Murdoch dmurdoch@watstat.waterloo.edu