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

            Bug ID: 30781
           Summary: APFloat does not correctly handle signaling NaN
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedb...@nondot.org
          Reporter: d...@su-root.co.uk
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

According to IEEE-754 2008 (7.2 Invalid operation) "any general-computational
or signaling-computational operation on a signaling NaN" should generate an
invalid operation exception and return a quiet NaN.

APFloat is supposed to be IEEE-754 2008 compliant but it does not handle this
part of the spec correctly. Currently if it performs an operation on a
signaling NaN it returns `APFloat::opOK` and a signaling NaN. Instead it should
return `APFloat::opInvalidOp` and a quiet NaN.

It appears this limitation is known about because in
`unittests/ADT/APFloatTest.cpp` there is this comment

```
  // TODOS/NOTES:
  // 1. Since we perform only default exception handling all operations with
  // signaling NaNs should have a result that is a quiet NaN. Currently they
  // return sNaN.
```

I couldn't find an open bug specifically for this issue so I'm opening this
one.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to