Proposal: Add a target lowering hook to state that target supports floating point exception behavior.

Hello All,

the patch below adds a target lowering hook to state that the target supports (or not) floating point exception behavior. The patch is small and contains one possible use for the hook (folding potentially exception raising fp operations).

Any comments?

Thanks

Pedro

opensource1.txt (3.7 KB)

Hi Pedro,

I would rename the variable FloatingPointExceptions to HasFloatingPointExceptions.

-Juergen

PS: Patches should go to llvm-commits

There's a lot of cut and paste in those routines. Can you do something
to unify it a bit? Also, do we have any ports that have support
floating point exceptions?

-eric

I assume you meant to ask for ports that *don’t* support floating point exceptions. To my knowledge, neither R600 nor NVPTX support floating point exceptions.

—Owen

Right, I did.

And cool, thanks. It just wasn't part of the patch so it seemed like
it was just dead code :slight_smile:

-eric

I assume you meant to ask for ports that *don’t* support floating point exceptions. To my knowledge, neither R600 nor NVPTX support floating point exceptions.

—Owen

SI at least does, although nothing is done with that currently

Even if your hardware supports it, I’m pretty confident that you would want to compile with this option disabled for OpenGL shaders. There’s no mechanism for the user to detect the exception in the language or the API, so you’d rather just have the constant folding.

—Owen