[LLVMdev] floating point exceptions in compare instructions

Rafael Espíndola rafael.espindola at gmail.com
Fri Oct 13 13:41:53 CDT 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 LLVMdev mailing list