-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc][libm][GPU] Populating 'libmgpu.a' for math on the GPU
This commit populates `libmgpu.a` with wrappers for the following built-ins - modf, modff - nearbyint, nearbyintf - remainder, remainderf - remquo, remquof - rint, rintf - scalbn, scalbnf - sqrt, sqrtf - tan, tanf - tanh, tanhf - trunc, truncf and wrappers the following vendor implementations - nextafter, nextafterf - sincos, sincosf - sinh, sinhf - sinf - tan, tanf - tanh, tanhf Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D153395
- Loading branch information
1 parent
5754f5a
commit 53f5bfd
Showing
43 changed files
with
1,027 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU modf 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/modf.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(double, modf, (double x, double *iptr)) { | ||
return __builtin_modf(x, iptr); | ||
} | ||
|
||
} // namespace __llvm_libc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU modff 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/modff.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(float, modff, (float x, float *iptr)) { | ||
return __builtin_modff(x, iptr); | ||
} | ||
|
||
} // namespace __llvm_libc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU nearbyint 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/nearbyint.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(double, nearbyint, (double x)) { | ||
return __builtin_nearbyint(x); | ||
} | ||
|
||
} // namespace __llvm_libc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU nearbyintf 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/nearbyintf.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(float, nearbyintf, (float x)) { | ||
return __builtin_nearbyintf(x); | ||
} | ||
|
||
} // namespace __llvm_libc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU remainder 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/remainder.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(double, remainder, (double x, double y)) { | ||
return __builtin_remainder(x, y); | ||
} | ||
|
||
} // namespace __llvm_libc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of the GPU remainderf 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/remainderf.h" | ||
#include "src/__support/common.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) { | ||
return __builtin_remainderf(x, y); | ||
} | ||
|
||
} // namespace __llvm_libc |
Oops, something went wrong.