#include <limits>
#include <type_traits>
-#ifdef __ANDROID_NDK__
-#include <android/api-level.h>
-#endif
-
#ifdef _MSC_VER
// Declare these intrinsics manually rather including intrin.h. It's very
// expensive, and MathExtras.h is popular.
template <> constexpr inline size_t CTLog2<1>() { return 0; }
-/// Return the log base 2 of the specified value.
-inline double Log2(double Value) {
-#if defined(__ANDROID_API__) && __ANDROID_API__ < 18
- return __builtin_log(Value) / __builtin_log(2.0);
-#else
- return log2(Value);
-#endif
-}
-
/// Return the floor log base 2 of the specified value, -1 if the value is zero.
/// (32 bit edition.)
/// Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
return ConstantFoldFP(log, APF, Ty);
case Intrinsic::log2:
// TODO: What about hosts that lack a C99 library?
- return ConstantFoldFP(Log2, APF, Ty);
+ return ConstantFoldFP(log2, APF, Ty);
case Intrinsic::log10:
// TODO: What about hosts that lack a C99 library?
return ConstantFoldFP(log10, APF, Ty);
case LibFunc_log2f_finite:
if (!APF.isNegative() && !APF.isZero() && TLI->has(Func))
// TODO: What about hosts that lack a C99 library?
- return ConstantFoldFP(Log2, APF, Ty);
+ return ConstantFoldFP(log2, APF, Ty);
break;
case LibFunc_log10:
case LibFunc_log10f: