summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/math-builtins.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for a limited subset of TS 18661-3 math builtins.Benjamin Kramer2018-01-061-6/+14
| | | | | | | | | | | | | | | | | These just overloads for _Float128. They're supported by GCC 7 and used by glibc. APFloat support is already there so just add the overloads. __builtin_copysignf128 __builtin_fabsf128 __builtin_huge_valf128 __builtin_inff128 __builtin_nanf128 __builtin_nansf128 This is the same support that GCC has, according to the documentation, but limited to _Float128. llvm-svn: 321948
* [CodeGen] fix mapping from fmod calls to frem instructionSanjay Patel2017-12-021-8/+10
| | | | | | Similar to D40044 and discussed in D40594. llvm-svn: 319619
* [CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsicsSanjay Patel2017-12-011-24/+24
| | | | | | | | | | | | | | | | There are 20 LLVM math intrinsics that correspond to mathlib calls according to the LangRef: http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics We were only converting 3 mathlib calls (sqrt, fma, pow) and 12 builtin calls (ceil, copysign, fabs, floor, fma, fmax, fmin, nearbyint, pow, rint, round, trunc) to their intrinsic-equivalents. This patch pulls the transforms together and handles all 20 cases. The switch is guarded by a check for const-ness to make sure we're not doing the transform if errno could possibly be set by the libcall or builtin. Differential Revision: https://reviews.llvm.org/D40044 llvm-svn: 319593
* [CodeGen] fix const-ness of cbrt and fmaSanjay Patel2017-11-131-6/+22
| | | | | | | | | | | cbrt() is always constant because it can't overflow or underflow. Therefore, it can't set errno. fma() is not always constant because it can overflow or underflow. Therefore, it can set errno. But we know that it never sets errno on GNU / MSVC, so make it constant in those environments. Differential Revision: https://reviews.llvm.org/D39641 llvm-svn: 318093
* [CodeGen] split math and complex tests into separate files; NFCISanjay Patel2017-11-071-0/+560
The files are already large, and we may need to add even more RUNs to distinguish differences based on OS, environment, or other platform things. llvm-svn: 317583
OpenPOWER on IntegriCloud