Skip to content

[libc][math] Refactor atan2f implementation to header-only in src/__support/math folder. #150993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc/shared/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "math/asinhf16.h"
#include "math/atan.h"
#include "math/atan2.h"
#include "math/atan2f.h"
#include "math/atanf.h"
#include "math/atanf16.h"
#include "math/erff.h"
Expand Down
23 changes: 23 additions & 0 deletions libc/shared/math/atan2f.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared atan2f function ----------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SHARED_MATH_ATAN2F_H
#define LLVM_LIBC_SHARED_MATH_ATAN2F_H

#include "shared/libc_common.h"
#include "src/__support/math/atan2f.h"

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::atan2f;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ATAN2F_H
17 changes: 17 additions & 0 deletions libc/src/__support/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,23 @@ add_header_library(
libc.src.__support.macros.optimization
)

add_header_library(
atan2f
HDRS
atan2f_float.h
atan2f.h
DEPENDS
.inv_trigf_utils
libc.src.__support.FPUtil.double_double
libc.src.__support.FPUtil.fenv_impl
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.multiply_add
libc.src.__support.FPUtil.nearest_integer
libc.src.__support.FPUtil.polyeval
libc.src.__support.macros.config
libc.src.__support.macros.optimization
)

add_header_library(
atanf
HDRS
Expand Down
Loading
Loading