   learning to make assembly based optimizations
  Anyone know where to find good tutorials on the various assembly instruction sets like MMX etc ? I've never used any assembly before, but it would seem like  a good idea to learn how to pack multiple instructions in one clock cycle.   
  Have you determined that that kind of optimization is necessary for your project? Learning it just for the sake of knowledge is one thing, but you shouldn't assume that your project is going to need assembly code optimizations. Most amateur projects won't. For that matter, you need to be pretty good at not just assembly, but knowing how compilers work, to know when coding in assembly will actually gain you anything.   ;  I'm looking to learn these things just to learn them. Figuring out when they actually help will come later.   ;Quote:Original post by vanegerI'm looking to learn these things just to learn them. Figuring out when they actually help will come later.I can't remember exactly, because i learned from a book/class, but I think IBM has some resources on assembly on their website.   ;  You could start with this, and refer to the CPU manuals from AMD/Intel (available from their websites) for the advanced instruction sets like SSE.   ;  What you need to get started is an actual problem to solve (could be made up if all else fails), a decently big data set, at least one way to reliable measure time, a decent C/C++ implementation to compare against and the manual for the platform you want to optimize on. Read through the instructions available, pick the ones that let you do the required calculations quickest and implement. Once you have done that, test it for correctness and performance (comparing against the reference C/C++ implementation). If you've reached your goal, quit, otherwise, improve.That's basically it. There's no big secrets the learn. The more you know how the CPU works, the better code you'll end up with. Optimizing, especially with assembly is very creative, but also very boring and often very frustrating work. Most people only do it if they absolutely have to and many not even then.   ;  And most compilers are fairly decent at optimising code already.....Assembly is very specific in its nature . Optimising for an athalon processor wont do anything for any other processors. Each and every single different processor will require separate code. It is far better to try and find a different method that gets around the road block without resorting to assembly.For instance have you considered using a look up table in place of calculations in your critical code?;  Lookup tables often slow things down though. You always have to profile.But I think the OP is trying to learn assembly just for fun, not due to misguided attempts at optimization.   ;  I do have a specific algorithm I'm trying to improve by learning this stuff, specifically trying to figure out MMX and the various SSE codes. I want to examine a file for redundancy at various bit sizes to determine what length of bits offers the most redundancy in a given file.From what I've read, one could code the comparisons using MMX/SSE code to compare multiple items in one instruction instead of having use higher level instructions that may take up more time. I can't test if this would actually improve the run time or not without learning how to implement mmx/sse .   ;  OK. First you will need a computer with the actual CPU that your working on(easier). You will also need an Assembler that understands all the machine coding for the target processor.A lot of information could be had from USENET and the hobby sectors but most of those sources appear to be dying so be prepared to open your wallet.Assuming the CPU is an Intel chip much of the info you are looking for can be either downloaded or purchased at the intel site. Be prepared for long and detailed explanations at the extremes of understanding. Be prepared to fill in the gaps as much of the information assumes you are an expert on the subject already. Often you will find the titles of more in-depth materials as referances in other manuals.You can easily do multiple comparisons but usually at the cost of doing extra prep work. Unless you have a situation where the prep work can be done first and then the compares are done inside a time critical loop your not going to realise much of a benefit. The newer CPUs often look ahead and pre-calculate results. Interfering with this process can easily result in a massive slow down so dont expect good results for a while.As was mentioned earlier, Run a profiler on the program first so your nor wasting your time.   