[LLVMdev] Large integers as first-class values

Eli Friedman eli.friedman at gmail.com
Sun Feb 28 13:07:42 PST 2010


On Sun, Feb 28, 2010 at 1:02 PM, Russell Wallace
<russell.wallace at gmail.com> wrote:
> On Sun, Feb 28, 2010 at 8:58 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> In terms of correctness, it should work except for the fact that the
>> LLVM code generators don't implement more complicated operations on
>> such integers, like multiplication, division, and variable-width
>> shifts.  The issues with returning large integers are fixed, at least
>> on x86.
>
> But not on other platforms?

If I recall correctly, there was some platform-specific work involved,
and I'm not sure it got done on all platforms.

> What's the largest integer such that something like 'return ((a * b) /
> c) >> d' works correctly on all major platforms?

Twice the size of a pointer, i.e. 64 bits on 32-bit platforms and 128
bits on 64-bit platforms.

-Eli




More information about the llvm-dev mailing list