[llvm-dev] Why x86_64 divq is not used for 128-bit by 64-bit division?

Paweł Bylica via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 19 13:47:49 PDT 2017


Hi there,

Let's have this C code:

unsigned long div(unsigned __int128 n, unsigned long d)
{
return n / d;
}

I would assume that the divq is the perfect match here. But the compiler
generates the
code that calls the __udivti3 procedure which performs 128-bit by 128-bit
division.

Why is divq not used here?

- Paweł
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171019/52b9cb69/attachment.html>


More information about the llvm-dev mailing list