This is an alternative to D141074 to fix the problem by adjusting
the precision control dynamically.
Posting for early review so we can do some testing of this solution.
Differential D142178
[X86] Change precision control to FP80 during u64->fp32 conversion on Windows. craig.topper on Jan 19 2023, 10:31 PM. Authored by
Details This is an alternative to D141074 to fix the problem by adjusting Posting for early review so we can do some testing of this solution.
Diff Detail
Event TimelineComment Actions This looks a good way to solve the problem.
This comment was removed by icedrocket.
Comment Actions Use the load version of fadd when possible. Only handling the case of loading an f32 value. Comment Actions Could you update the diff? The current diff is outdated and cannot be applied to main branch automatically.
Comment Actions Remove unrelated comment change. The line is longer than 80 columns, but isn't near code this is touching.
Comment Actions I wrote some code to verify that u64 to f64 conversion using FILD+FADD with 53-bit precision is accurate. I tested it with 10^12 cases and the results are: u64 to f32 conversion failed frequently, but u64 to f64 conversion does not failed. https://reviews.llvm.org/F26366621 Comment Actions The u64->f64 conversion can only fail if PC is set to single precision. The original bug we are fixing is that with PC set to double precision we round from fp80 to fp64 then to fp32. If PC is set to single precision we have a lot more problems with f64. |
This should be in the same line.