In any compiled language your optimizer will do all those weird things for you, and will even handle all the different generations of CPUs for you. Compilers never give you a better algorithm if you write the wrong one.
Almost all languages have a standard library that has all the normal algorithems you would want, and where something wierd is better they have that done for you.
Almost all languages have a standard library that has all the normal algorithems you would want, and where something wierd is better they have that done for you.