Remove definition of std::fmaf from libc++. Fixes bug #18910. This function should come from the C standard library. As a drive-by fix, update the tests to remove a warning from -Wabsolute-value
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1208,11 +1208,7 @@ fdim(_A1 __x, _A2 __y) _NOEXCEPT
|
|||||||
|
|
||||||
// fma
|
// fma
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);}
|
using ::fmaf;
|
||||||
#ifndef FP_FAST_FMAF
|
|
||||||
#define FP_FAST_FMAF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using ::fma;
|
using ::fma;
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);}
|
inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);}
|
||||||
|
@@ -190,8 +190,8 @@ void test_fabs()
|
|||||||
static_assert((std::is_same<decltype(std::fabs((unsigned long long)0)), double>::value), "");
|
static_assert((std::is_same<decltype(std::fabs((unsigned long long)0)), double>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::fabs((double)0)), double>::value), "");
|
static_assert((std::is_same<decltype(std::fabs((double)0)), double>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::fabs((long double)0)), long double>::value), "");
|
static_assert((std::is_same<decltype(std::fabs((long double)0)), long double>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::fabsf(0)), float>::value), "");
|
static_assert((std::is_same<decltype(std::fabsf(0.0f)), float>::value), "");
|
||||||
static_assert((std::is_same<decltype(std::fabsl(0)), long double>::value), "");
|
static_assert((std::is_same<decltype(std::fabsl(0.0L)), long double>::value), "");
|
||||||
assert(std::fabs(-1) == 1);
|
assert(std::fabs(-1) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user