Search code examples
compiler-constructionllvm

LLVM frontend supporting large integers


I'm currently looking for an LLVM frontend that supports large integers like i128, i256 and i512. As far as I know rust and clang support i128, but nothing above.

Does such a frontend exist already or do I have to make my own?


Solution

  • Recently added into clang (In the upcoming Clang 12) is _ExtInt(N), implementing N2472 in C and C++.

    Basically, the types _ExtInt(N) and unsigned _ExtInt(N) expose iN for arbitrary N in llvm. So you could use these:

    typedef _ExtInt(256) i256;
    typedef _ExtInt(512) i512;
    

    in the C or C++ frontends.