Assembly vs. higher level languages like C.
-
Use instructions that are so CPU specific and useful for your needs that compilers don't implement.
-
Use instructions in a way that is smarter than any compiler is likely to do.
Note however that it gets harder and harder to make code more efficient using assembler because compilers are smarter and smarter.
Access low level hardware which is so hardware specific it is not implemented in standard C.
You write for a single CPU architecture only.
Other things are much more likely to speed up your code if that's what you want, namely:
- better algorithms
- better cache usage
and only then, using assembly may stand a change to speeding thing up.