2

I was wondering whether any given compiler can generate an output directly to the micro architecture level instead of the ISA level. I understand that the microprogramming level is not being used usually these days and the hardware executes instructions directly at the ISA level. But is it possible? And why is it not done so much these days? Thank you.

Rogue
  • 56
  • 1
  • 9
  • The simple answer is yes. Generation of microcode is just generating code at one layer further down. Ganesh suggests some reasons why this is not popular. – Ira Baxter Jan 26 '14 at 22:59

1 Answers1

4

CPUs don't generally expose an interface that lets you access the microprogramming instructions directly - indeed there's no binary format for those instructions. So there'd be no way a compiler could target them and no point in it doing so as noone would be able to use the resulting binary.

Even if it were possible, it wouldn't be a great idea - the ISA is the standard that is guaranteed to remain backwards compatible, whereas the internal microcode is available for the processor vendor to change whenever it is convenient. It is also likely to be a lot less compressed than the ISA, so binaries would be bigger and you'd lose out on performance in the instruction cache.

Ganesh Sittampalam
  • 28,821
  • 4
  • 79
  • 98
  • "you'd lose out on performance" - and on compatibility between CPU models and manufacturers. AMD's microcode is likely different from Intel's &c. – JimmyB Jan 27 '14 at 00:09