www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/03/12:43:51

Date: Fri, 3 May 1996 18:35:12 +0200 (METDST)
From: Alexander Lehmann <alexlehm AT rbg DOT informatik DOT th-darmstadt DOT de>
To: Martynas Kunigelis <martynas DOT kunigelis AT VM DOT KTU DOT LT>
Cc: DJGPP mailing list <djgpp AT delorie DOT com>
Subject: Re: register calling convention
In-Reply-To: <199605031525.RAA20026@rs2.hrz.th-darmstadt.de>
Message-Id: <Pine.HPP.3.91.960503183155.15280B-100000@hp62.rbg.informatik.th-darmstadt.de>
Mime-Version: 1.0

Hello all,

On Fri, 3 May 1996, Martynas Kunigelis wrote:

> 
> I would like to ask somebody with knowledge on this: does register calling
> convention really *improve* the code speed??? I mean I spent a lot of time
> trying to imlement it in DJGPP. I would dare to update the assembly parts
> of DJGPP libc if we come to a conclusion that it is worth it.

I'm not sure how the effect is on a 80x86 cpu, I have programmed a lot with
m68k processors in the past (Atari ST), where register calling seems to improve
the code quite a bit in some cases (there usually 3 data and 2 address
registers are scratch registers and e.g. PureC uses these to pass the first
parameters, which means that e.g. most libc functions do not pass parameters
on the stack at all (except the ones with ..., of course)). However, due to
less available registers and the cache memory used in newer processors, this
may not have that much effect, in a way, the CPU cache acts as a register
extension, since the bytes around the stack pointer fill always be in cache,
I guess.

In addition to the assembly parts, it probably also some of the functions
supporting variable argument lists (e.g. printf) have to changed. Plus, it
is necessary to have the appropriate header files included when accessing these
functions with register calling, since otherwise parameters may get passed
wrong. (Since most people probably use -Wall, at least on their own programs,
this is will be warned about anyway).

bye, Alexander

-- 
Alexander Lehmann,                                  |  "On the Internet,
alex AT hal DOT rhein-main DOT de  (plain, MIME, NeXT)         |   nobody knows
alexlehm AT rbg DOT informatik DOT th-darmstadt DOT de (plain)     |   you're a dog."
<URL:http://www.student.informatik.th-darmstadt.de/~alexlehm/>

- Raw text -


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