[cfe-dev] Implement foo in terms of __builtin_foo fails

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 26 14:33:11 PST 2018


On Mon, Feb 26, 2018 at 04:08:50PM +0000, Jon Chesterfield via cfe-dev wrote:
> I can now present this problem more clearly. I was missing flags
> fno-math-errno, fno-trapping-math, but clang is also missing some
> functionality.

Depending on the amount of control you have over your toolchain, you can
disable errno-reporting completely. I consider that a historic mistake
in general and the standard quite allows that. -fno-trapping-math should
not be necessary in general, what do you need it for?

The other thing to keep in mind is that LLVM is still quite limited in
what it can do for the intrinsics beyond lowering to instructions. Given
that few CPUs have decent transcendental FP support, that isn't that
high on the priority list for most. I.e. the range reduction on x86 is
completely broken for the trigonometric functions etc.

Joerg



More information about the cfe-dev mailing list