Unverified Commit 52340a4f authored by Anonmiraj's avatar Anonmiraj Committed by GitHub
Browse files

[libc][math] Refactor round-roundeven-trunc family to header-only (#195590)

Refactors the round-roundeven-trunc math family to be header-only.

part of: #147386

Target Functions:
  - round
  - roundbf16
  - roundf
  - roundf128
  - roundf16
  - roundl
  - roundeven
  - roundevenbf16
  - roundevenf
  - roundevenf128
  - roundevenf16
  - roundevenl
  - trunc
  - truncbf16
  - truncf
  - truncf128
  - truncf16
  - truncl
parent 3a5f8ae6
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -410,6 +410,18 @@
#include "math/rintf128.h"
#include "math/rintf16.h"
#include "math/rintl.h"
#include "math/round.h"
#include "math/roundbf16.h"
#include "math/roundeven.h"
#include "math/roundevenbf16.h"
#include "math/roundevenf.h"
#include "math/roundevenf128.h"
#include "math/roundevenf16.h"
#include "math/roundevenl.h"
#include "math/roundf.h"
#include "math/roundf128.h"
#include "math/roundf16.h"
#include "math/roundl.h"
#include "math/rsqrtf.h"
#include "math/rsqrtf16.h"
#include "math/scalbln.h"
@@ -470,6 +482,12 @@
#include "math/totalordermagf128.h"
#include "math/totalordermagf16.h"
#include "math/totalordermagl.h"
#include "math/trunc.h"
#include "math/truncbf16.h"
#include "math/truncf.h"
#include "math/truncf128.h"
#include "math/truncf16.h"
#include "math/truncl.h"
#include "math/ufromfp.h"
#include "math/ufromfpbf16.h"
#include "math/ufromfpf.h"
+23 −0
Original line number Diff line number Diff line
//===-- Shared round 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_ROUND_H
#define LLVM_LIBC_SHARED_MATH_ROUND_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::round;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ROUND_H
+23 −0
Original line number Diff line number Diff line
//===-- Shared roundbf16 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_ROUNDBF16_H
#define LLVM_LIBC_SHARED_MATH_ROUNDBF16_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::roundbf16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ROUNDBF16_H
+23 −0
Original line number Diff line number Diff line
//===-- Shared roundeven 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_ROUNDEVEN_H
#define LLVM_LIBC_SHARED_MATH_ROUNDEVEN_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::roundeven;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ROUNDEVEN_H
+23 −0
Original line number Diff line number Diff line
//===-- Shared roundevenbf16 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_ROUNDEVENBF16_H
#define LLVM_LIBC_SHARED_MATH_ROUNDEVENBF16_H

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

namespace LIBC_NAMESPACE_DECL {
namespace shared {

using math::roundevenbf16;

} // namespace shared
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SHARED_MATH_ROUNDEVENBF16_H
Loading