← Back to context

Comment by lolsowrong

6 hours ago

Most of the time. But sometimes, no. See ATL thunk emulation (last I checked, still alive in the windows kernel) and ntvdm handling of the BOP pseudoinstruction.

See also: Jazelle DBX.

Hell, on modern x86 processors, many “native” instructions are actually a series of micro-ops for a mostly undocumented and mostly poorly understood microcode architecture that differs from the natively documented instruction set.

It’s turtles all the way down.

Aren't all of them microcoded? Some years back root was achieved on a line of intel processors and new instructions implemented as proof of concept. There's an academic paper, citation not immediately to hand.

  • Some instructions are microcoded but others take the fast path and avoid the microcode sequencer. Can't patch the latter in microcode RAM.

  • I saw the paper from Google last year and thought something in it aligned with not everything running through the microcode engine, though I could be wrong.

Jazelle and micro-ops are not interpreters, they are executed in hardware.

  • I believe only some parts of Jazelle are handled in hardware, though I don’t know if anybody has got their hands on any of the bits of the software side. I do know there’s documentation on handling unimplemented instructions.

    I don’t know how I feel about micro-ops being executed in hardware - I mostly agree, but also, microcode updates exist…

  • An interpreter implemented in hardware is still an interpreter. Hot take, all machine instruction sets are scripting languages and LLVM is a transpiler.