4 ms·
Compilers almost never emit instructions that are microcoded on any modern processor
by firethief 8y ago
Compilers almost never emit instructions that are microcoded on any modern processor
- codetrotter 8y agoPlease explain what you mean. The microcode is the “firmware” of sorts of the CPU. What instructions we tell the CPU to execute and what the CPU decides to actually do to achieve the same result you are asking for can be different. What do you mean by the instructions not being microcoded?
- imtringued 8y agoThere is no rule that every instruction has to be implemented with microcode. Simple instructions like adding two numbers don't need it. Microcode is generally used for more complicated instructions, often those with a variable number of cycles. They are also usually not the fastest way to achieve a result.
- cesarb 8y ago> What do you mean by the instructions not being microcoded? Most common instructions in modern CPU cores are decoded directly into the corresponding micro-operation(s), without involving the microcode ROM. Only the most complex instructions, involving many micro-operations, will use the microcode decoder. Also, there are often several copies of the simpler instruction decoder, so the CPU can decode several instructions in a single cycle, while there's normally a single copy of the complex (microcode-using) instruction decoder. A good resource if you want to read more is part 3 of https://www.agner.org/optimize/ https://www.agner.org/optimize/ which describes the decoder (and other parts) of several families of x86 processors.
- codetrotter 8y agoThanks