]> granicus.if.org Git - clang/commit
[CodeGen] map sqrt libcalls to llvm.sqrt when errno is not set
authorSanjay Patel <spatel@rotateright.com>
Tue, 31 Oct 2017 20:19:39 +0000 (20:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 31 Oct 2017 20:19:39 +0000 (20:19 +0000)
commit7f519c8361480c7e2951b82e666eb5ccd316da01
tree6073ca72cbb5d852b6ee020f7f674c76be1d0c38
parent210431c8134fdeff30834467022ce8c306a4c1dd
[CodeGen] map sqrt libcalls to llvm.sqrt when errno is not set

The LLVM sqrt intrinsic definition changed with:
D28797
...so we don't have to use any relaxed FP settings other than errno handling.

This patch sidesteps a question raised in PR27435:
https://bugs.llvm.org/show_bug.cgi?id=27435

Is a programmer using __builtin_sqrt() invoking the compiler's intrinsic definition of sqrt or the mathlib definition of sqrt?

But we have an answer now: the builtin should match the behavior of the libm function including errno handling.

Differential Revision: https://reviews.llvm.org/D39204

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317031 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/2005-07-20-SqrtNoErrno.c [deleted file]
test/CodeGen/builtin-sqrt.c [new file with mode: 0644]
test/CodeGen/libcalls.c