Index: [thread] [date] [subject] [author]
  From: WolfWings ShadowFlight <wolfwings@lightspeed.net>
  To  : ggi-develop@eskimo.com
  Date: Thu, 9 Jul 1998 01:04:01 -0700 (PDT)

Re: Fast lines

On Wed, 8 Jul 1998, James A Simmons wrote:

>Why does anyone use floting point. I have created line drawing algorthims
>that used floating point. On most ix86 and RISC this is much faster. Also
>you don't have to woory about which quadrant the line is in. 

Okay, this needs to be said:
We've hashed, and rehashed the line-drawing algo discussion too many times
already, the existing implementation is best overall for _ALL_
architectures. Yes, it flat-out sucks on some, but overall, it's the best
one that was agreed upon. Floating-point, straight bressenham, all have
been brought up before, and on many arch's they're better than the current
one, but not on all architectures GGI runs on currently, like the piddly
little 386/16 behind me, or the 486/7Mhz to my right. (286 I ripped apart
and plugged one of those illicit 486 upgrade chip boards into. :-)

On these, the FPU simply doesn't exist, so floating-point algo's are out,
and fixed-point is in the same boat as the shifts can murder the speed,
while the run-length bresenham works best, as it can take advantage of the
REP STOSx, and also it can be a simple 2-line loop at the innermost layer
most of the time, which is very good for these older machines. 

Then, there's the P200MMX I'm sitting at now. Heh. :-)
FPU is just great, but not that great.
Fixed-point can be good if you abuse the MMX just right.
Sliced-bresenham is still king though, due to the great loop prediction
the CPU has, so again, at the low and high end of the x86
spectrum, the sliced-bresenham is best due to the ultra-tight nature of
the inner loops.

Then, there's the P2 series... Anything works there, end of discussion.

The original Pentiums... well, that's pretty much a 486 in disguise,
really, aside from the beefed-up FPU. The jump prediction has a fatal set
of flaws, so it's useless, etc, etc. In fact, this is the only chip where
a 2-3 line innermost loop is a _bad_ thing as it hits the jump prediction
too often. Yes, the jump prediction in an original Pentium can't be beaten
on rapid-fire. :-)
             _
     _     _|_  WolfWings ShadowFlight
| | | | | | | | wolfwings@lightspeed.net
| | | | | | | | "Love is a bird,
|_|_| |_|_| | |  She needs to fly...
 _           /   Let all the hurt,
 \-.______,-'    Inside of you die..." - Madonna, Frozen

Index: [thread] [date] [subject] [author]