I have to optimise "C" code in assembly for an assessment and was wondering where the documentation was on the topic.
C++ could never be as efficient as raw assembly but my understanding seems to end there. But since I have to fulfil a marking criteria, where can I talk the bad optimisations the compiler makes?
Actually, most compilers nowadays are quite good at optimizing code. For trivial programs you could probably do it better by hand, but anything else...
Compilers generally create assembler output (not all of them, but most) that you could edit, other than that many compilers have support for inline assembly of some sort, but barely anyone stays true to the standard here.
For trivial programs, I would think the compiler would do an even better job! As far as I've seen, time is MUCH better spent optimizing algorithms than fragments of code. I would also say that profiling is absolutely necessary to identify what needs attention, as well. That is, if you're serious about getting actual results.