the instruction decoder is split up into two main categories: simple and complex.
Simple instructions are decoded into micro-ops directly by hardware. For example, the MOV instruction in x86 is straight forward. A basic ADD instruction is also fairly straight forward, the only complication is needing to know if the arguments are a memory location or not (since if it were being translated into something RISC like, would need a MOV equivalent, then an ADD). Also if you think about it, this is important from a performance standpoint: if you have to go through a
software program for every instruction, it's going to be much slower than to simply have hardware do it. And you'd have to have a really bad day to screw up the hardware circuitry for a simple ADD instruction.
See
https://www.realworldtech.com/nehalem/5/, if you look at the diagram, the only thing touching the Microcode, or μCode as labeled in the diagram, is the complex decoder.
According to
this paper:
"Most Intel CPUs have multiple decoders: several simple decoders to translate x86 instructions that map to a single μop, a complex decoder to translate instructions that map to 1-4 μops, and a Microcode Sequencer responsible for translating microcoded instructions. Microcoded instructions are the most complex instructions that require advanced logic to be executed. Examples are cpuid that returns detailed information about the CPU and wrmsr that modifies internal settings in model-specific registers (MSRs)."
it's incorrect to say that everything runs on microcode, because the instruction decoder can handle so-called simple instructions directly.
That's not true. Every x86 instruction gets translated into a micro-op. Even if it's a 1:1 translation, there's still a translation.
Again, from the above paper (Introduction, first paragraph):
"Microcode is the hidden software layer between the instruction set and the underlying hardware. In most Complex Instruction Set Architectures (CISC), each instruction, or macro-instruction, is translated into one or more micro-operations (μops) that are executed by the underlying hardware. In total, there are over 2700 distinct μops in Intel x86. Many simple instructions map to a single μop. However, more complex instructions are essentially entire programs and can map to > 50 μops. Microcode is a crucial optimization for these instructions, as μops are much simpler to implement in hardware and can be pipelined more efficiently."
If you want to understand how microcode truly works in modern CPUs, definitely read that paper. I only read the Abstract, Intro, and Background sections. That's only 2.5 pages and will increase your understanding, greatly.
Microcode is only a concern with certain complex operations because they can be hard to get right the first time and extensive testing is not feasible. But you don't need this for basic CPU instructions like MOV or ADD.
I wouldn't be too sure about that. If we're talking x86, even
mov isn't as simple as you probably think it is. If you mean register-to-register copy, then sure. Likewise,
add can have memory operands and those can involve address arithmetic.
In fact, most native RISC implementations don't have microcode. Example, ARM's Cortex A710:
Note that "micro-op" is
not the same as microcode.
Don't read too much into that diagram. It's a reconstruction (i.e. not-authoritative) meant only for illustrative purposes. Also, if modern CPUs don't implement microcode in micro-ops, then what?
If you're confused as to the difference between microcode and microoperation
IMO, it's a slightly artificial distinction. The instruction decoders are an indirection layer. What the CPU executes are micro ops. The microcode could be seen as the definition of that translation layer.
I guess the distinction you could make is between microcoded and simpler instructions. However, depending on how many instructions could be
potentially microcoded, you could still say it's the microcode, writ large, which defines how programs are run on the CPU.