[llvm-dev] Combining fast math flags with constrained intrinsics

Wols Lists via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 21 10:26:55 PST 2020


On 21/01/20 17:59, Kaylor, Andrew via llvm-dev wrote:
> Overall, the picture I'm getting is that we need to have some sort of table of FP semantic modes and document which ones we consider orthogonal, which ones we consider mutually exclusive, and what effects various pragmas will have on each of them. Melanie worked through a lot of these issues in her patch to add the -fp-model and related command line options. Maybe we can generalize that to our reasoning about the IR and put it in the language ref.

As a user (I did a load of programming ages ago calculating distances
from lats and longs), I heartily second having it documented!

I've known for ages that (some) computers can handle infinity and stuff,
and if I'd known that the compiler/language got it right it would have
made my life much simpler. As it was I had to special-case anywhere two
lats or longs were equal, whereas the maths just said "a divide by zero
will promptly be followed by a divide by infinity so it all cancels out".

Being able to rely on the compiler would have been so much nicer.

Cheers,
Wol


More information about the llvm-dev mailing list