diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt --- a/libc/src/math/generic/CMakeLists.txt +++ b/libc/src/math/generic/CMakeLists.txt @@ -822,7 +822,6 @@ ../log1p.h DEPENDS .common_constants - .log_range_reduction libc.src.__support.FPUtil.fenv_impl libc.src.__support.FPUtil.fp_bits libc.src.__support.FPUtil.multiply_add diff --git a/libc/src/math/generic/log1p.cpp b/libc/src/math/generic/log1p.cpp --- a/libc/src/math/generic/log1p.cpp +++ b/libc/src/math/generic/log1p.cpp @@ -17,7 +17,6 @@ #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY #include "common_constants.h" -#include "log_range_reduction.h" namespace __llvm_libc { diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -722,6 +722,29 @@ ], ) +libc_support_library( + name = "__support_fputil_double_double", + hdrs = ["src/__support/FPUtil/double_double.h"], + deps = [ + ":__support_common", + ":__support_number_pair", + ":__support_fputil_multiply_add", + ], +) + +libc_support_library( + name = "__support_fputil_dyadic_float", + hdrs = ["src/__support/FPUtil/dyadic_float.h"], + deps = [ + ":__support_common", + ":__support_uint", + ":__support_macros_optimization", + ":__support_fputil_float_properties", + ":__support_fputil_fp_bits", + ":__support_fputil_multiply_add", + ], +) + libc_support_library( name = "__support_osutil_syscall", hdrs = ["src/__support/OSUtil/syscall.h"], @@ -1022,6 +1045,16 @@ ], ) +libc_support_library( + name = "log_range_reduction", + hdrs = ["src/math/generic/log_range_reduction.h"], + deps = [ + ":__support_common", + ":common_constants", + ":__support_fputil_dyadic_float", + ], +) + libc_math_function( name = "expm1f", additional_deps = [ @@ -1119,6 +1152,65 @@ ], ) +libc_math_function( + name = "log", + additional_deps = [ + ":__support_fputil_fma", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ":common_constants", + ":log_range_reduction", + ], +) + +libc_math_function( + name = "log2", + additional_deps = [ + ":__support_fputil_fma", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ":common_constants", + ":log_range_reduction", + ], +) + +libc_math_function( + name = "log10", + additional_deps = [ + ":__support_fputil_fma", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ":common_constants", + ":log_range_reduction", + ], +) + +libc_math_function( + name = "log1p", + additional_deps = [ + ":__support_fputil_fma", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ":common_constants", + ], +) + libc_math_function( name = "sinhf", additional_deps = [ diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel @@ -641,6 +641,34 @@ ], ) +math_test( + name = "log", + deps = [ + "//libc/utils/MPFRWrapper:mpfr_wrapper", + ], +) + +math_test( + name = "log2", + deps = [ + "//libc/utils/MPFRWrapper:mpfr_wrapper", + ], +) + +math_test( + name = "log10", + deps = [ + "//libc/utils/MPFRWrapper:mpfr_wrapper", + ], +) + +math_test( + name = "log1p", + deps = [ + "//libc/utils/MPFRWrapper:mpfr_wrapper", + ], +) + math_test( name = "sinhf", deps = [