diff options
author | Preston Gurd <preston.gurd@intel.com> | 2013-05-27 15:44:35 +0000 |
---|---|---|
committer | Preston Gurd <preston.gurd@intel.com> | 2013-05-27 15:44:35 +0000 |
commit | b704d23062aa78b00999b75dcdcb628d4d84ee3f (patch) | |
tree | f12904f5ac1680c5c7b3e1e7e7ea956714eef3af /include/llvm/Target | |
parent | f594e41ae901efdec35e335ce7b01b3c19e83e3c (diff) | |
download | llvm-b704d23062aa78b00999b75dcdcb628d4d84ee3f.tar.gz llvm-b704d23062aa78b00999b75dcdcb628d4d84ee3f.tar.bz2 llvm-b704d23062aa78b00999b75dcdcb628d4d84ee3f.tar.xz |
Convert sqrt functions into sqrt instructions when -ffast-math is in effect.
When -ffast-math is in effect (on Linux, at least), clang defines
__FINITE_MATH_ONLY__ > 0 when including <math.h>. This causes the
preprocessor to include <bits/math-finite.h>, which renames the sqrt functions.
For instance, "sqrt" is renamed as "__sqrt_finite".
This patch adds the 3 new names in such a way that they will be treated
as equivalent to their respective original names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetLibraryInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLibraryInfo.h b/include/llvm/Target/TargetLibraryInfo.h index 5f01c8d835..4b9c0442dc 100644 --- a/include/llvm/Target/TargetLibraryInfo.h +++ b/include/llvm/Target/TargetLibraryInfo.h @@ -57,6 +57,12 @@ namespace llvm { dunder_isoc99_sscanf, /// void *__memcpy_chk(void *s1, const void *s2, size_t n, size_t s1size); memcpy_chk, + /// double __sqrt_finite(double x); + sqrt_finite, + /// float __sqrt_finite(float x); + sqrtf_finite, + /// long double __sqrt_finite(long double x); + sqrtl_finite, /// char * __strdup(const char *s); dunder_strdup, /// char *__strndup(const char *s, size_t n); @@ -677,6 +683,8 @@ public: case LibFunc::sin: case LibFunc::sinf: case LibFunc::sinl: case LibFunc::cos: case LibFunc::cosf: case LibFunc::cosl: case LibFunc::sqrt: case LibFunc::sqrtf: case LibFunc::sqrtl: + case LibFunc::sqrt_finite: case LibFunc::sqrtf_finite: + case LibFunc::sqrtl_finite: case LibFunc::floor: case LibFunc::floorf: case LibFunc::floorl: case LibFunc::nearbyint: case LibFunc::nearbyintf: case LibFunc::nearbyintl: case LibFunc::ceil: case LibFunc::ceilf: case LibFunc::ceill: |