[LLVMdev] floating point exceptions in compare instructions

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Oct 13 11:41:53 PDT 2006


> Nope, you want non-trapping instructions.  If you use trapping
> instructions, C99 functions like isgreater will not work correctly with
> NAN's.

How do I know when to use a trapping instruction? For example consider
this C function:
------------------------
int f(float a, float b) {
        return a <= b;
}
------------------------

gcc uses fcmpes instead of fcmps...

> -Chris

Thanks,
Rafael



More information about the llvm-dev mailing list