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

From: elf AT netcom DOT com (Marc Singer)
Message-Id: <199610281815.KAA00544@netcom12.netcom.com>
Subject: Re: Strength reducing? [was Re: DJGPP V2.01 loop unrolling bug]
To: vecna AT engin DOT umich DOT edu (Jimmy Wan)
Date: Mon, 28 Oct 1996 10:15:57 -0800 (PST)
Cc: djgpp AT delorie DOT com (DJGPP List Alias)
In-Reply-To: <551fg8$mk4@lastactionhero.rs.itd.umich.edu> from "Jimmy Wan" at Oct 28, 96 05:14:44 am
MIME-Version: 1.0

> Strength reduction is the use of simpler and less complex instructions
> to do the same thing.  For example, instead of multiplying an integer
> by 2, left shift it by 1.  Much much faster.  Personally, I explicitly
> use the shifts in my code anyway.  BTW, anyone have a clock cycle
> listing for 486's, P5's and P6's?  Or know where I can get one?  I have
> one for the 8086 and the 80186 and those really aren't going to do me
> any good...

In general, cycle counts are not very reliable because of the pipline
interlocks on the newer CPUs.  You can order the spec books from intel
FOR FREE.  These have cycle counts, for what they are worth.  The
better way is to use the clock counting instruction of the pentium
(and better) to check cycle counts.  On the 486, raw cycle counts are
more-or-less accurate.  Best thing to do is to time it.

-- Marc

- Raw text -


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