[cfe-dev] Floating-point traps on x86-64

Dallman, John via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 8 09:42:53 PST 2019


Cameron wrote:

> The X86 backend has not been made trap-safe yet. IMO, the lion's share of the trap-unsafe optimizations
> are before the backend.

The x86 backend will be responsible for the paired SSE2 instructions, won’t it? This code uses quite a lot of divides and square roots, and paired instructions without care for the other half of the pair are deadly there.

> You might get lucky trying the constrained intrinsics now (maybe).
> That said, performance at this point will be horrible. Perhaps worse than -O0.

Ouch.

> I also require something like this for my work. The constrained intrinsics implementation
> is a step in the right direction, but there's a long long way to go. You may be able to use
> it to flush out Invalid/Overflow/Zero issues in the source, but would not be able to run
> production quality code with traps enabled anytime soon.

The source is under continuous development, and we have testing with traps active on MSVC, GCC, Solaris and AIX. They can all manage this with production-quality code. So we’d be looking for problems created by Clang. Sadly, having floating-point traps active causes actual Clang quality problems to be hidden in the haystack of floating-point errors.

--
John Dallman

-----------------
Siemens Industry Software Limited is a limited company registered in England and Wales.
Registered number: 3476850.
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190308/804db42c/attachment.html>


More information about the cfe-dev mailing list