Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!claris!apple!baum From: baum@apple.UUCP (Allen J. Baum) Newsgroups: comp.arch Subject: Re: RISC is a nasty no-no! Message-ID: <7482@apple.UUCP> Date: 1 Mar 88 19:06:33 GMT References: <179@wsccs.UUCP: <696@nuchat.UUCP: <284@scdpyr.UUCP> <25699@linus.UUCP> <11199@duke.cs.duke.edu> <25723@linus.UUCP> <8332@eddie.MIT.EDU> Reply-To: baum@apple.UUCP (Allen Baum) Organization: Apple Computer, Inc. Lines: 11 -------- [] RE: needing multiplies in array accesses Accessing arbitrary array elements is non extremely common. Most of the array references are inside loops, and use the loop induction variables as part of the subscript expression. A good compiler will strength reduce these multiply operations and turn them into add/subtract immediates. Even if this is not possible, the multiply operation is generally reg*imm, which reduces to a shift in the common cases (power of two array sizes are pretty common!), or a SMALL series of shifts and adds. -- {decwrl,hplabs,ihnp4}!nsc!apple!baum (408)973-3385