Backend support for divisions > 128 bits


Thanks you very much for LLVM! I’m very much enjoying working with it.

I’m currently experimenting with some frontend changes that eventually generate IR with arbitrary big integer types like

define void @test(i129, i129, i129*) {
%4 = sdiv i129 %0, %1
store i129 %4, i129* %2
ret void

(or any bigger type). Unfortunately, this leads to “LLVM ERROR: Unsupported library call operation!” from DAGTypeLegalizer::ExpandIntRes_SDIV on all targets I tried (especially x86_64). It seems that most of the other operations (e.g. mul, add, and, shift, bitreverse, …) are supported on those big integers.

What is the best way for me to make the divisions work?
Is there existing work I can build upon?

Thank you!

Most of the other operations are trivial to synthesize in a somewhat
reasonable way. Division is not. That's why there is no generic