Precision loss during round-trip of ppc_fp128
hexadecimal floating-point constants (double-double arithmetic)
#124
Labels
Milestone
There is a known precision loss when parsing and printing LLVM IR assembly containing
ppc_fp128
hexadecimal floating-point constants. This issue was identified by @dannypsnl, and the cause has been researched by @dannypsnl (see #31 (comment)) and @scottshotgg (see #31 (comment)).Below follows a proof of concept illustrating the precision loss for the
ppc_fp128
constant0xM400C0000000000300000000010000000
. From #31 (comment)Link to failing test case:
llvm/ir/constant/const_float_test.go
Line 16 in 433f268
Changing the precision of the
math/big.Float
from106
(which is the precision of double-double arithmetic) to1048
fixes this issue and resolves the loss of precision (see #31 (comment)). However, simply changing the precision to1048
does not seem like the right fix, since it will affect the results of future arithmetic on these constants and may result in more memory usage and loss of performance.Leaving this issue open in the hopes that someone has the expertise needed to figure out what is going wrong, and come up with a solution.
ref to sister issue #31.
The text was updated successfully, but these errors were encountered: