www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/12/10:02:24

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Asm question
Date: Fri, 12 Feb 1999 09:57:28 -0500
Lines: 30
Message-ID: <36C44158.35A4@erols.com>
References: <3 DOT 0 DOT 6 DOT 32 DOT 19990212092623 DOT 00840750 AT pop DOT netaddress DOT com>
Mime-Version: 1.0
X-Trace: OgveNJuOAPWBY7ZoeoqoRUnPdXmRJIvXYt/hky1gV7U=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 12 Feb 1999 14:58:44 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Paul Derbyshire wrote:
> 
> I notice gcc zeroes eax using
> 
> xorl  %eax, %eax
> 
> rather than
> 
> movl  $0, %eax
> 
> Is the xorl faster or more pipelinable or something? Seems
> counterintuitive. :-)

  The xorl is a two byte instruction, the movl is a five
byte instruction.  If they were the same speed then it
is likely that using the shorter instruction will
result in slightly faster overall execution because
(averaged over several instances) it will reduce the
number of cache misses.

  On some CPU's they simply are the same speed (before
considering the cache miss issue).  On other CPU's this
question has generated a lot of discussion in
comp.lang.asm.x86, and it seems likely that on some
CPU's under some conditions the movl would be faster.
(I am not certain of that).  Check dejanews, if you
want to read all the discussion on that topic.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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