www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/09/04:25:54

Date: Wed, 9 Sep 1998 11:20:46 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Endlisnis <s257m AT unb DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: MAJOR slowdowns in translating TP7 gfx code to DJGPP2: Suplement
In-Reply-To: <35F5A6C5.5551B40F@unb.ca>
Message-ID: <Pine.SUN.3.91.980909112036.1090G-100000@is>
MIME-Version: 1.0

On Tue, 8 Sep 1998, Endlisnis wrote:

> 	I looked at the asm code generated for the div function, it
> doesn't look too optimal, it might be faster to use "/" and "%"
> instead. 

As far as I can see, that's exactly what `div' does, except that it
also handles the case of a negative divisor (in the usual case, where
it's positive, you only pay two comparisons, which isn't a lot).

> The div function is more than 40 instructions

What matters is not the total number of instructions, but the number
of instructions that are actually executed in the usual case, see
above.

> or does it check for div by zero or something?

See the sources (IMHO, anybody who is serious about DJGPP programming
should have djlsr201.zip on their machine).

- Raw text -


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