www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/13/21:32:10

Xref: news2.mv.net comp.os.msdos.djgpp:4942
From: lehmann AT mathematik DOT th-darmstadt DOT de (Alexander Lehmann)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Speed optimization: memcpy() or for loop ??
Date: 13 Jun 1996 13:02:14 GMT
Organization: Technische Hochschule Darmstadt
Lines: 24
Message-ID: <4pp3gm$bi0@rs18.hrz.th-darmstadt.de>
References: <4pmlrp$p7u AT crc-news DOT doc DOT ca> <4pmscu$nrt AT rs18 DOT hrz DOT th-darmstadt DOT de> <4pn7dp$2d2 AT crc-news DOT doc DOT ca>
NNTP-Posting-Host: fb0432.mathematik.th-darmstadt.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Richard Young (richard DOT young AT crc DOT doc DOT ca) wrote:

: With the powerful offset addressing modes of today's processors I find it hard 
: to believe that 

: 	for(i=n,px=x,py=y; i ; i--) *py++=*px++;

: is faster than 

: 	for (i = 0; i < n; i++) x[i] = y[i];

Actually, you may be right, I wasn't aware that there is an address
mode that multiplies the index register by 4. Which one is actually
faster may depend on the processor type and maybe also on the
optimization level.


bye, Alexander

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

- Raw text -


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