[llvm-bugs] [Bug 44019] New: Strict fp->int needs to trigger an invalid exception if the input value is out of range for the destination value when hardware can't detect it

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 15 17:47:07 PST 2019


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

            Bug ID: 44019
           Summary: Strict fp->int needs to trigger an invalid exception
                    if the input value is out of range for the destination
                    value when hardware can't detect it
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: craig.topper at gmail.com
                CC: llvm-bugs at lists.llvm.org

If the direct conversion to the result type isn't support by hardware we
currently promote the operation to a supported hardware conversion followed by
a truncate. But this will only trigger an exception if the input is out of
range for the promoted result type.

This is being done in multiple places. Either in type legalization if the
result type isn't legal. During op legalization if the target sets an
operationAction of Promote. Or in the case of X86(maybe other targets), in a
Custom handler.

We should insert a range check and a jump to code that will trigger an invalid
exception, like 0.0 divided by 0.0.

-- 
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/20191116/39e63c51/attachment.html>


More information about the llvm-bugs mailing list