delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/17/21:06:33

From: leathm AT solwarra DOT gbrmpa DOT gov DOT au (Leath Muller)
Message-Id: <199703180157.LAA23908@solwarra.gbrmpa.gov.au>
Subject: Re: Weird problem
To: ao950 AT FreeNet DOT Carleton DOT CA
Date: Tue, 18 Mar 1997 11:57:23 +1000 (EST)
Cc: djgpp AT delorie DOT com
In-Reply-To: <5ggll4$6pb@freenet-news.carleton.ca> from "Paul Derbyshire" at Mar 16, 97 11:30:44 am

> But, an article on optimization informed me that using a 32-bit compiler
> like DJGPP, if you use shorts and such it adds a whole extra instruction
> for every operation in registers on the value in question, and that to
> speed up code use "int" instead. So I guess portability and optimization
> are sometimes exclusive?

If you are running in 32 bit protected mode, any instructions that operate
on 16 bit operands require an instruction prefix and an extra cycle to
execute. If your running is 16 bit protected mode or real mode (not sure
about the real mode bit, never used it! ;) it has the same problem with
32 bit operands. To make your code faster in 32 bit mode, use 32 bit and
8 bit values, and in 16 bit code you would use 16 bit and 8 bit operands.

Leathal.

- Raw text -


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