[LLVMdev] Ordered / Unordered FP compare are not handled properly on X86

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Aug 29 00:49:54 PDT 2013


On 29 Aug 2013, at 08:19, Tim Northover <t.p.northover at gmail.com> wrote:

> If so, a compare that used that instruction would have to become more
> like an "invoke" with a landingpad for the exception and so on,
> wouldn't it? The current fcmp can already distinguish between ordered
> and unordered, because ucomiss provides that information.

There are currently lots of limitations in the expressiveness of LLVM IR for floating point operations (e.g. distinguishing between trapping and non-trapping cases and representing the floating point environment).  If anyone wants to fully implement the floating point part of C99 (or Fortran!) then they will quickly hit problems.  I believe that this kind of thing is usually implemented on-demand, and so until someone (maybe those nice folks at Argonne National Laboratory) who cares about numerical accuracy makes it a priority.  

David





More information about the llvm-dev mailing list