Floating point ordered and unordered comparisons

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.

Thanks,
Sundeep

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

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

Thanks for your reply Eli. I will check how to convert unordered
operations back to ordered one. I have another related question - is it
possible for frontend (clang) to generate unordered operation from the
source code?

-Sundeep

Some builtins like __builtin_isnormal will generate them.

-Eli