3 ms·
The usual way to support a larger instruction set than is actually implemented in the chip is to "trap" unimplemented instructions, and then emulate them with a
by ncmncm 7y ago
The usual way to support a larger instruction set than is actually implemented in the chip is to "trap" unimplemented instructions, and then emulate them with a subroutine in the runtime library. A trap is like an interrupt, but generated from the instruction stream.
Of course this is a lot slower than the instruction might have been, but at least the code runs and produces the right answer.
Sometimes the trap does not change the execution sequence of externally visible instructions, but instead directs the machine to execute a sequence of internal microcode, while externally it looks like the machine has stalled. Indeed, on some machines all instructions trap this way.
Modern CISC chips do a more sophisticated form of the latter, where RISCs have typically avoided it for most or all operations.
So, whether and how RISC-V implementations emulate extensions will vary. Emulation generally doesn't produce very nice results, for this kind of operation -- the purpose of the instruction is to give users access to custom machinery wired into the core, for speed, and without the machinery the programmer might have preferred to achieve the results some other way.