[llvm-dev] Print 128 bit value at runtime using printf

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon May 29 12:41:21 PDT 2017


On 29 May 2017 at 12:17, Jajoo, Malhar via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Please see the code in red below , as I am having a bit difficulty in trying
> to print the 128 bit value computed at runtime. The code in red is never
> executed since the value may never be casted to a ConstantInt.

The same answer applies now as when you asked last week. printf cannot
format an i128 so you need to do that yourself. You need to write a
"print128" function and insert a call to that instead of (or as well
as) printf. Link your compiled code against your implementation of
print128 and you should be good to go.

Tim.


More information about the llvm-dev mailing list