[llvm-dev] Backend support for divisions > 128 bits

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 11 15:03:51 PST 2019


On Mon, Nov 11, 2019 at 11:45:12PM +0100, Matthias Gehre via llvm-dev wrote:
> Hello,
> 
> 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.

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

Joerg


More information about the llvm-dev mailing list