Episode 61: Internals of GCC
As a programmer, you need to make sure that your code will run as best as possible (with a good performance and good compatibility) with the CPU your program is intended to run, this means that a good compiler for your code is needed, that's where GCC can be used, using GCC you can generate the front end and the back end with little modifications to run in any platform.
A compiler will pass multiple times the code to implement everything needed, from the multiple front end implementation that may not be available in C for example, that natively does not support polymorphism, but can be implemented with the correct extensions, or this multiple passes can be used to optimize depending on the platform, operating system or CPU architecture (x86, arm, RISC V etc). Also, the language will delete "garbage code" in the lowest level of your code, will look for small machine code instructions and replace them with faster, better and more secure instructions, increasing the efficiency on your code.
X86, 32 bit integer has an small amount of registers that are actually used during standard programming, it has been extended for the 64 bit version, but the compiler usually reserves this new registers for specific intern areas or instructions and most of the time are not available for your application. New iterations of gcc will be better implementing efficient code given the new characteristics of modern CPU's, where this new CPU's have more cores and threads that can split some workloads.
Ahead of time compilation: is the way many enviroments precompile the code you are working on, this can be useful for some programming languages like java, where you have a lot of flexibility in the application, or "dynamic libraries". Also, you dont need a powerful computer to do this compilation.
Comentarios
Publicar un comentario