While going thru a self-inflicted learning exercise of optimizing code that... well... probably shouldn't be optimized ;) I was tring to pair some instructions & realized that I can't tell U from V yet... yea I'm a bit slow :P... Anyone want to give me a quick edjukashun...
Agner Fog's help file is probably the best start. At first only try to optimise loops of code that get executed very many times (1000+). Before you get down to the pipes, look at the data your moving around. I've never seen the U or V pipe, I only know them by what instruction run in them. :P Look at Agner's help file - read it start to finish. Come back and post some code for a specific problem, after you have tried it - I'm sure one of the code magicians around here will help. :) And we will all learn.
First off, I'm sorry that I can't track down a link or 2 for ya. I'm swamped with work at the moment. :) But yes, read Agner's help. He does spend some time on organizing your prog to take advantage of the pipes. I guess the important thing is to have a V pipe inst always follow a U pipe one. But the inst sequence doesn't always make this easy, as you have already learned... It all depends on where you "start". But even if you don't start in the right place, the odds are pretty good that your prog will take advantage of both pipes, considering the number of combinations of instructions that will run together. This type of opt can have an impact on the "core" level of your prog. But for the "bye and bye" code, as in the rest of your program, it really doesn't matter much. After all, we're talking about a few clocks, at what, 1 gig these days? Anyway, Intel also has a Pentium opt guide on their site, in PDF format. If I ever get done with this fr**king project at work, I'll post a link or 2 here for ya... :)
Agner's optimisation manual is a part of the Masm32 install. His web site is: www.agner.org/assem _Shawn This message was edited by _Shawn, on 4/4/2001 2:47:28 AM