sundeepk at codeaurora.org
2013-Jul-09 22:00 UTC
[LLVMdev] 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
Eli Friedman
2013-Jul-09 22:34 UTC
[LLVMdev] Floating point ordered and unordered comparisons
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
sundeepk at codeaurora.org
2013-Jul-10 03:21 UTC
[LLVMdev] Floating point ordered and unordered comparisons
> 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
Possibly Parallel Threads
- [LLVMdev] Floating point ordered and unordered comparisons
- [LLVMdev] Floating point ordered and unordered comparisons
- Help understanding and lowering LLVM IDS conditional codes correctly
- Help understanding and lowering LLVM IDS conditional codes correctly
- Help understanding and lowering LLVM IDS conditional codes correctly