Skip to content

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

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
addec87
[libc][math] Refactor ldexpf128 implementation to header-only in src/…
bassiounix Jul 10, 2025
697efcd
[libc][math] Refactor ldexpf16 implementation to header-only in src/_…
bassiounix Jul 10, 2025
363a701
[libc][math] Refactor ldexpf implementation to header-only in src/__s…
bassiounix Jul 10, 2025
5284b8e
[libc][math] Refactor exp implementation to header-only in src/__supp…
bassiounix Jul 11, 2025
b6503f0
fix style
bassiounix Jul 11, 2025
3fc1140
[libc][math] Refactor exp10 implementation to header-only in src/__su…
bassiounix Jul 12, 2025
26646c5
[libc][math] Refactor exp10f implementation to header-only in src/__s…
bassiounix Jul 13, 2025
9d1279d
[libc][math] Refactor exp10f16 implementation to header-only in src/_…
bassiounix Jul 13, 2025
b5d474e
[libc][math] Refactor acos implementation to header-only in src/__sup…
bassiounix Jul 13, 2025
cfcd849
libc][math] Refactor acosf implementation to header-only in src/__sup…
bassiounix Jul 13, 2025
2837d2f
fix styles
bassiounix Jul 13, 2025
f1ebe57
[libc][math] Refactor acosf16 implementation to header-only in src/__…
bassiounix Jul 13, 2025
61b1190
fix style
bassiounix Jul 13, 2025
0afc137
[libc][math] Refactor erff implementation to header-only in src/__sup…
bassiounix Jul 13, 2025
3c92206
[libc][math] Refactor acoshf implementation to header-only in src/__s…
bassiounix Jul 13, 2025
558975c
[libc][math] Refactor acoshf16 implementation to header-only in src/_…
bassiounix Jul 14, 2025
205f58b
[libc][math] Refactor acospif16 implementation to header-only in src/…
bassiounix Jul 14, 2025
7106dc4
[libc][math] Refactor asin implementation to header-only in src/__sup…
bassiounix Jul 14, 2025
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
15 changes: 15 additions & 0 deletions libc/shared/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@

#include "libc_common.h"

#include "math/acos.h"
#include "math/acosf.h"
#include "math/acosf16.h"
#include "math/acoshf.h"
#include "math/acoshf16.h"
#include "math/acospif16.h"
#include "math/asin.h"
#include "math/erff.h"
#include "math/exp.h"
#include "math/exp10.h"
#include "math/exp10f.h"
#include "math/exp10f16.h"
#include "math/expf.h"
#include "math/expf16.h"
#include "math/frexpf.h"
#include "math/frexpf128.h"
#include "math/frexpf16.h"
#include "math/ldexpf.h"
#include "math/ldexpf128.h"
#include "math/ldexpf16.h"

#endif // LLVM_LIBC_SHARED_MATH_H
23 changes: 23 additions & 0 deletions libc/shared/math/acos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared acos 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_ACOS_H
#define LLVM_LIBC_SHARED_MATH_ACOS_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acos;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ACOS_H
23 changes: 23 additions & 0 deletions libc/shared/math/acosf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared acosf 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_ACOSF_H
#define LLVM_LIBC_SHARED_MATH_ACOSF_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acosf;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ACOSF_H
29 changes: 29 additions & 0 deletions libc/shared/math/acosf16.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===-- Shared acosf16 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_ACOSF16_H
#define LLVM_LIBC_SHARED_MATH_ACOSF16_H

#include "include/llvm-libc-macros/float16-macros.h"

#ifdef LIBC_TYPES_HAS_FLOAT16

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acosf16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LIBC_TYPES_HAS_FLOAT16

#endif // LLVM_LIBC_SHARED_MATH_ACOSF16_H
23 changes: 23 additions & 0 deletions libc/shared/math/acoshf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared acoshf 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_ACOSHF_H
#define LLVM_LIBC_SHARED_MATH_ACOSHF_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acoshf;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ACOSHF_H
29 changes: 29 additions & 0 deletions libc/shared/math/acoshf16.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===-- Shared acoshf16 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_ACOSHF16_H
#define LLVM_LIBC_SHARED_MATH_ACOSHF16_H

#include "include/llvm-libc-macros/float16-macros.h"

#ifdef LIBC_TYPES_HAS_FLOAT16

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acoshf16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LIBC_TYPES_HAS_FLOAT16

#endif // LLVM_LIBC_SHARED_MATH_ACOSHF16_H
29 changes: 29 additions & 0 deletions libc/shared/math/acospif16.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===-- Shared acospif16 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_ACOSPIF16_H
#define LLVM_LIBC_SHARED_MATH_ACOSPIF16_H

#include "include/llvm-libc-macros/float16-macros.h"

#ifdef LIBC_TYPES_HAS_FLOAT16

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::acospif16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LIBC_TYPES_HAS_FLOAT16

#endif // LLVM_LIBC_SHARED_MATH_ACOSPIF16_H
23 changes: 23 additions & 0 deletions libc/shared/math/asin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared asin 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_ASIN_H
#define LLVM_LIBC_SHARED_MATH_ASIN_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::asin;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ASIN_H
23 changes: 23 additions & 0 deletions libc/shared/math/erff.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared erff 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_ERFF_H
#define LLVM_LIBC_SHARED_MATH_ERFF_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::erff;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ERFF_H
23 changes: 23 additions & 0 deletions libc/shared/math/exp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared exp 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_EXP_H
#define LLVM_LIBC_SHARED_MATH_EXP_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::exp;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_EXP_H
23 changes: 23 additions & 0 deletions libc/shared/math/exp10.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared exp10 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_EXP10_H
#define LLVM_LIBC_SHARED_MATH_EXP10_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::exp10;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_EXP10_H
24 changes: 24 additions & 0 deletions libc/shared/math/exp10f.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//===-- Shared exp10f 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_EXP10F_H
#define LLVM_LIBC_SHARED_MATH_EXP10F_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::exp10f;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_EXP10F_H
29 changes: 29 additions & 0 deletions libc/shared/math/exp10f16.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===-- Shared exp10f16 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_EXP10F_H
#define LLVM_LIBC_SHARED_MATH_EXP10F_H

#include "include/llvm-libc-macros/float16-macros.h"

#ifdef LIBC_TYPES_HAS_FLOAT16

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::exp10f16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LIBC_TYPES_HAS_FLOAT16

#endif // LLVM_LIBC_SHARED_MATH_EXP10F_H
23 changes: 23 additions & 0 deletions libc/shared/math/ldexpf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===-- Shared ldexpf 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_LDEXPF_H
#define LLVM_LIBC_SHARED_MATH_LDEXPF_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::ldexpf;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_LDEXPF_H
29 changes: 29 additions & 0 deletions libc/shared/math/ldexpf128.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===-- Shared ldexpf128 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_LDEXPF128_H
#define LLVM_LIBC_SHARED_MATH_LDEXPF128_H

#include "include/llvm-libc-types/float128.h"

#ifdef LIBC_TYPES_HAS_FLOAT128

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::ldexpf128;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LIBC_TYPES_HAS_FLOAT128

#endif // LLVM_LIBC_SHARED_MATH_LDEXPF128_H
Loading
Loading