DIV that traps is for binary compatibility, not performance.
Yes but this is better than not implementing the trap.
Wait, 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.
There’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)