Open gabrielrodcanal opened 3 months ago
I initially added this to match the MLIR behaviour. It would be great to gather some more examples and match the printing for various float formats. A short-term solution would be to just print with the default Python printing.
Hi there, I have noticed that xDSL truncates the precision of floating point numbers in its output. This doesn't affect any pass in particular, since just running the MLIR code through xdsl-opt reduces the precision. Here's a minimal example to reproduce it:
After the code is run through
xdsl-opt
it will produce:NOTE: After a Zulip discussion, @AntonLydike pointed out the problem is at https://github.com/xdslproject/xdsl/blob/987abb56d45a710d16985c64b194cae342c1a191/xdsl/printer.py#L524
NOTE 2: since in this example we are dealing with a dense attribute, the problem is at https://github.com/xdslproject/xdsl/blob/987abb56d45a710d16985c64b194cae342c1a191/xdsl/printer.py#L582 where there is also truncation.