cakeml icon indicating copy to clipboard operation
cakeml copied to clipboard

Addition of multiplication and division in Pancake

Open Kswin01 opened this issue 1 year ago • 1 comments

Necessary in some cases, and the current workarounds for not having access to multiplication and division are not the most elegant.

Kswin01 avatar Mar 16 '23 23:03 Kswin01

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.

IlmariReissumies avatar Mar 23 '23 03:03 IlmariReissumies