Why don't compilers generate microinstructions and not build code?

I would like to know why in the real world compilers produce assembly code , not microinstructions .

If you are already tied to one architecture , why not go even further and free the processor from the need to turn assembler code into microcommands in Runtime?

I think there might be a bottleneck in the implementation , but I did not find anything on Google.

EDIT with micro instructions. I mean: if the assembly instruction is ADD (R1, R2), then it will be microcommands. Load R1 into ALU, load R2 into ALU, perform the operation, load the results back to R1. Another way to see this is to equate one micro-instruction with one clock cycle.

I got the impression that microinstruction was an official name. Apparently there is a run here.

F

+4
source share
3 answers

Compilers do not produce micro-instructions because processors do not execute micro-instructions. They are a detail of the implementation of the chip, and not something exposed outside the chip. There is no way to provide micro-instructions to the chip.

+16
source

Since the x86 processor does not perform microoperations, it executes operation codes. You cannot create a binary image containing microoperations, since there is no way to encode them in the way the CPU understands.

What you offer is basically a new set of RISC-style instructions for x86 processors. The reason this does not happen is because it will break compatibility with a huge number of applications and operating systems written for the x86 instruction set.

+8
source

The answer is pretty simple.

(Some) compilers do generate code sequences such as load r1, load r2, add r2 to r1. But these are machine code instructions (which you call microcode). These instructions are the only and only interface between the outside world and the internal components of the processor.

(Other compilers only generate C and allow the C backend, such as gcc, to take care of the dirty details.)

0
source

All Articles