[libcxx] r202990 - 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
Marshall Clow
mclow.lists at gmail.com
Wed Mar 5 09:09:52 PST 2014
Author: marshall
Date: Wed Mar 5 11:09:51 2014
New Revision: 202990
URL: http://llvm.org/viewvc/llvm-project?rev=202990&view=rev
Log:
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
Modified:
libcxx/trunk/include/cmath
libcxx/trunk/test/numerics/c.math/cmath.pass.cpp
Modified: libcxx/trunk/include/cmath
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cmath?rev=202990&r1=202989&r2=202990&view=diff
==============================================================================
--- libcxx/trunk/include/cmath (original)
+++ libcxx/trunk/include/cmath Wed Mar 5 11:09:51 2014
@@ -1208,11 +1208,7 @@ fdim(_A1 __x, _A2 __y) _NOEXCEPT
// fma
-inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);}
-#ifndef FP_FAST_FMAF
-#define FP_FAST_FMAF
-#endif
-
+using ::fmaf;
using ::fma;
inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);}
Modified: libcxx/trunk/test/numerics/c.math/cmath.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/numerics/c.math/cmath.pass.cpp?rev=202990&r1=202989&r2=202990&view=diff
==============================================================================
--- libcxx/trunk/test/numerics/c.math/cmath.pass.cpp (original)
+++ libcxx/trunk/test/numerics/c.math/cmath.pass.cpp Wed Mar 5 11:09:51 2014
@@ -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((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::fabsf(0)), float>::value), "");
- static_assert((std::is_same<decltype(std::fabsl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(std::fabsf(0.0f)), float>::value), "");
+ static_assert((std::is_same<decltype(std::fabsl(0.0L)), long double>::value), "");
assert(std::fabs(-1) == 1);
}
More information about the cfe-commits
mailing list