Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!srhqla!demott!kdq From: kdq@demott.com (Kevin D. Quitt) Newsgroups: comp.sys.m68k Subject: Re: inst. cache/optimization Message-ID: <1991Jan10.200633.25442@demott.com> Date: 10 Jan 91 20:06:33 GMT References: <1991Jan10.104609.1939@vax5.cit.cornell.edu> Distribution: comp Organization: DeMott Electronics Co., Van Nuys CA Lines: 22 To answer your second question first, unrolling loops speeds up code because the loop tests and branches are eliminated. For a loop wholly inside the cache, branches are very inexpensive, as they generally fall into the "best" catagory - 0 or 1 cycles for most common branches. So, if you can make it fit in the cache, make it fit. If your program doesn't fit into the cache, it's probably still a win to keep the cache active, since the cache is filled 32 bits at a time, and some of your instructions are only going to be 16 bits (so the second instruction will be a hit). It's really a tough call, since you could look at the timing charts and build some super-efficient code for the portion you lock in, (or if your memory is slow you'd get the same effect). -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last