www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/06/06:04:16

From: moskewicz AT MEM DOT po DOT com
Date: Thu, 6 Jun 1996 06:03:45 -0400
Message-Id: <9606061003.AA04198@mercury>
To: djgpp AT delorie DOT com
Subject: Re: Are near pointers worth it?

>> and VESA 2 linear frame buffers. If I were to use near pointers would
>> it make it any faster?

>I think not. I got about a 5% speedup of my putpixel() function from
>using near pointers, and that is the absolute worst case becuase it
>involves a segment load per pixel. If you are just setting the selector
>once for any more significant drawing tasks, the overhead is so small
as
>to be totally insignificant.

I would agree totally, using near pointers is not worth it. Remember,
GCC
doesn't touch %fs and %gs, so just put your selector there, and you only
load it once. Just watch out for the _far* family, as they will clobber
%fs
(though you'd probably be using them for the same selector anyway!).
A final note: Using far pointers, at best, still costs 1 cycle per pixel
over
near pointers, for the seg override, and may screw up P5 pairing, as the
seg override will not pair, and counts as an instruction (sort of).
Still, this
could be 1/100 of a second per frame... I think.
----
moskewicz AT mem DOT po DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019