Skip to content

Commit a2300a6

Browse files
committed
[libc][math] Refactor atan2f implementation to header-only in src/__support/math folder.
1 parent d411e78 commit a2300a6

File tree

10 files changed

+427
-348
lines changed

10 files changed

+427
-348
lines changed

libc/shared/math.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "math/asinhf16.h"
2525
#include "math/atan.h"
2626
#include "math/atan2.h"
27+
#include "math/atan2f.h"
2728
#include "math/atanf.h"
2829
#include "math/atanf16.h"
2930
#include "math/erff.h"

libc/shared/math/atan2f.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- Shared atan2f function ----------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SHARED_MATH_ATAN2F_H
10+
#define LLVM_LIBC_SHARED_MATH_ATAN2F_H
11+
12+
#include "shared/libc_common.h"
13+
#include "src/__support/math/atan2f.h"
14+
15+
namespace LIBC_NAMESPACE_DECL {
16+
namespace shared {
17+
18+
using math::atan2f;
19+
20+
} // namespace shared
21+
} // namespace LIBC_NAMESPACE_DECL
22+
23+
#endif // LLVM_LIBC_SHARED_MATH_ATAN2F_H

libc/src/__support/math/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ add_header_library(
213213
libc.src.__support.macros.optimization
214214
)
215215

216+
add_header_library(
217+
atan2f
218+
HDRS
219+
atan2f_float.h
220+
atan2f.h
221+
DEPENDS
222+
.inv_trigf_utils
223+
libc.src.__support.FPUtil.double_double
224+
libc.src.__support.FPUtil.fenv_impl
225+
libc.src.__support.FPUtil.fp_bits
226+
libc.src.__support.FPUtil.multiply_add
227+
libc.src.__support.FPUtil.nearest_integer
228+
libc.src.__support.FPUtil.polyeval
229+
libc.src.__support.macros.config
230+
libc.src.__support.macros.optimization
231+
)
232+
216233
add_header_library(
217234
atanf
218235
HDRS

0 commit comments

Comments
 (0)