[LLVMdev] Floating-Point Overflow check

Steffen Geißinger steffen.geissinger at googlemail.com
Fri Jul 23 07:20:26 PDT 2010


Hi,

i need to check if an overflow of an floating-point arithmetic operation
occured.
Currently I'm doing something like this (for addition):

(LHS > 0 && RHS > 0 && sum <= 0)  || (LHS < 0 && RHS < 0 && sum >= 0)

This is checked for every addition.
Is there a more efficient way like the intrisic for int overflow?
How is it possible to raise a signal like SIGFPE?

Thanks!

Regards,
Steffen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100723/2c8c67a7/attachment.html>


More information about the llvm-dev mailing list