[LLVMdev] Large integers as first-class values

Russell Wallace russell.wallace at gmail.com
Sun Feb 28 11:54:32 PST 2010


LLVM supports integers up to about 8 million bits. This is a wonderful
feature that I would like to expose in the language I'm designing, so
that if you were, say, implementing SHA512, you could write the code
in terms of variables of type [int 512], and have it all work with
near optimal efficiency, the size known at compile time, and (unlike
the case where you were using an arbitrary precision integer class) no
heap allocation.

So my question is, is it okay to go ahead and do this, or are there
any caveats in terms of efficiency or correctness? In particular, I
remember reading something about there being problems with returning
integers larger than two machine words, but I can't find it again; is
there currently any such problem, or is it the case that if there was,
it's fixed now?



More information about the llvm-dev mailing list