by amelius · 4y ago · 0 comments
Or you can use a JIT compiler ...
I mean the extreme case is obviously a scripting language , where lowering to multiplication may well be possible.
That said you are correct in a JIT being vastly more heavyweight than most cases would need - but mostly due to the cost of making an indirect call rather than the cost of the jit itself
this is annoyingly non-trivial, and exactly the sort of thing that gets culled for JIT performance.
the problem isn't generating code properly targeted at the hardware, or unrolling late-binding cycle wasting.