[llvm-bugs] [Bug 36391] New: VectorLegalizer::ExpandUINT_TO_FLOAT -- wrong results for v*f64

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 15 04:55:04 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36391

            Bug ID: 36391
           Summary: VectorLegalizer::ExpandUINT_TO_FLOAT -- wrong results
                    for v*f64
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ruttenberg at reservoir.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19866
  --> https://bugs.llvm.org/attachment.cgi?id=19866&action=edit
Proposed fix

This code inadvertently does a 32 bit calculation whose result must be 64 bits,
resulting in incorrect floating point conversions.

When the underlying components of the vector are f64, BW is 64 and the shift:

1 << (BW/2) results in an undefined result when BW >= 31.

We need to write as lL << (BW/2) in order to do the shift in 64 bits with a 64
bit result.  Patch attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180215/131d520e/attachment-0001.html>


More information about the llvm-bugs mailing list