[LLVMdev] Floating point ordered and unordered comparisons

Eli Friedman eli.friedman at gmail.com
Tue Jul 9 15:34:37 PDT 2013


On Tue, Jul 9, 2013 at 3:00 PM,  <sundeepk at codeaurora.org> wrote:
> Hi All,
>
> I noticed LLVM target independent side is converting an ordered less than
> "setolt"  into unordered greater than "setuge" operation. There are no
> target hooks to control going from the ordered mode into unordered.
>
> I am trying to figure out the best way to support unordered operation on
> Hexagon. We don't have a single instruction to do unordered operation. So
> we will have to break it down into 2 instructions - check if unordered
> followed by the actual operation.
>
> I looked at X86 and ARM and it seems like both targes support unordered
> comparisons. I would prefer target independent part not to transform
> ordered ops into unordered. Is it a good idea? How do other targets
> support this feature?
>
> I don't have a lot of experience dealing with floating points. I will
> really appreciate any help here.

The function ISD::getSetCCInverse() would probably be useful for you
here: you can use it to transform an unordered operation into an
ordered operation.

-Eli



More information about the llvm-dev mailing list