-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc][math]fadd implementation #99694
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===-- Implementation of fadd function ----------------------------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "src/__support/macros/config.h" | ||
|
||
#ifndef LLVM_LIBC_SRC_MATH_FADD_H | ||
#define LLVM_LIBC_SRC_MATH_FADD_H | ||
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Header guards should precede everything except the file header with license information. |
||
|
||
namespace LIBC_NAMESPACE_DECL { | ||
|
||
float fadd(double x, double y); | ||
|
||
} // namespace LIBC_NAMESPACE_DECL | ||
|
||
#endif // LLVM_LIBC_SRC_MATH_FADD_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,6 +452,18 @@ add_entrypoint_object( | |
-O3 | ||
) | ||
|
||
add_entrypoint_object( | ||
fadd | ||
SRCS | ||
fadd.cpp | ||
HDRS | ||
../fadd.h | ||
DEPENDS | ||
libc.src.__support.FPUtil.basic_operations | ||
Comment on lines
+461
to
+462
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should depend on |
||
COMPILE_OPTIONS | ||
-O3 | ||
) | ||
|
||
add_entrypoint_object( | ||
trunc | ||
SRCS | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===-- Implementation of fadd function ----------------------------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "src/math/fadd.h" | ||
#include "src/__support/FPUtil/generic/add_sub.h" | ||
#include "src/__support/common.h" | ||
#include "src/__support/macros/config.h" | ||
|
||
namespace LIBC_NAMESPACE_DECL { | ||
|
||
LLVM_LIBC_FUNCTION(float, fadd, (double x, double y)) { | ||
return fputil::generic::add<float>(x, y); | ||
} | ||
|
||
} // namespace LIBC_NAMESPACE_DECL |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//===-- Unittests for fadd ----------------------------------------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "AddTest.h" | ||
|
||
#include "src/math/fadd.h" | ||
|
||
LIST_ADD_TESTS(float, double, LIBC_NAMESPACE::fadd) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//===-- Unittests for fadd ----------------------------------------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "AddTest.h" | ||
|
||
#include "src/math/fadd.h" | ||
|
||
LIST_ADD_TESTS(float, double, LIBC_NAMESPACE::fadd) |
Uh oh!
There was an error while loading. Please reload this page.