summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/builtin-sqrt.c
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> ↵Sanjay Patel2017-11-021-4/+2
| | | | | | | | | | | | | | | | | functions that might set errno This just makes const-ness of the builtins match const-ness of their lib function siblings. We're deferring fixing some of these that are obviously wrong to follow-up patches. Hopefully, the bugs are visible in the new test file (added at rL317220). As the description in Builtins.def says: "e = const, but only when -fmath-errno=0". This is step 2 of N to fix builtins and math calls as discussed in D39204. Differential Revision: https://reviews.llvm.org/D39481 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317265 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] map sqrt libcalls to llvm.sqrt when errno is not setSanjay Patel2017-10-311-0/+19
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