cakeml
cakeml copied to clipboard
Addition of multiplication and division in Pancake
Necessary in some cases, and the current workarounds for not having access to multiplication and division are not the most elegant.
I've been hacking on this for a couple of days. Multiplication should be unproblematic, but division less so.
The main issue is that not all target platforms have a division instruction that we can target, in particular ARMv7 and ag32. For those platforms, we'd have to decide to either not support division, or have the compiler insert a canned software implementation. (CakeML does the latter.) Either way, it requires making the Pancake compiler aware of what the target ISA is in a much earlier stage than is currently done.
What are people's thoughts on this? I personally think a software division implementation is somewhat contrary to the spirit of Pancake, and I'd rather not have division for such cases.