How to get a string out of an __mlir_type.i256 ?
Using the llvm dialect, I can add numbers of any size, In this picture I add 256 bit numbers.
This compiled and ran, which is wonderful, but now I don't know how to get a string out of var c so I can see the result.
In stdlib, the way to print a scalar is so convoluted and complex that I was not able to understand it. If someone knows how to do it using simple MLIR operations, it could benefit anyone trying to create a custom mojo type using MLIR.
In the Modular tutorial, where they create a custom Bool type, they just check if the type is one of two values "False" or "True" to print the result. This is not a viable solution for a type that is bigger than a Bool.
![No description](https://cdn.answeroverflow.com/1254578356389679226/Screenshot_from_2024-06-23_05-29-22.png)
2 Replies
you’d have to cast it to a uint8 and go from there
Curious about the implementation if you may🧐 @curiosity.fan @benny