3 ms·
Yes but this is better than not implementing the trap.
by prettyStandard 4y ago
Yes but this is better than not implementing the trap.
- pclmulqdq 4y agoWait, having no DIV instruction will result in faster code than having a DIV that traps. The compiler picks up the code that happens in the trap and can optimize it. For example, the code for an 8-bit division can be a lot faster than a 32-bit DIV on a microcontroller.
- Someone 4y agoThere’s also the overhead of trapping (registers get saved, the CPU may switch to kernel mode). For a single integer division, chances are that adds significant overhead compared to a subroutine call (let alone inlined code)