16 changes: 16 additions & 0 deletions libc/src/math/nvptx/lroundf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU lroundf 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/lroundf.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(long, lroundf, (float x)) { return __builtin_lroundf(x); }

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/modf.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, modf, (double x, double *iptr)) {
return __builtin_modf(x, iptr);
}

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/modff.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, modff, (float x, float *iptr)) {
return __builtin_modff(x, iptr);
}

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/nearbyint.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, nearbyint, (double x)) {
return __builtin_nearbyint(x);
}

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/nearbyintf.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, nearbyintf, (float x)) {
return __builtin_nearbyintf(x);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/nextafter.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, nextafter, (double x, double y)) {
return internal::nextafter(x, y);
return __nv_nextafter(x, y);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/nextafterf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, nextafterf, (float x, float y)) {
return internal::nextafterf(x, y);
return __nv_nextafterf(x, y);
}

} // namespace LIBC_NAMESPACE
File renamed without changes.
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/pow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===-- Implementation of the pow function for GPU ------------------------===//
//
// 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/pow.h"
#include "src/__support/common.h"

#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, pow, (double x, double y)) { return __nv_pow(x, y); }

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/powf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===-- Implementation of the powf function for GPU -----------------------===//
//
// 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/powf.h"
#include "src/__support/common.h"

#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, powf, (float x, float y)) { return __nv_powf(x, y); }

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/remainder.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, remainder, (double x, double y)) {
return __builtin_remainder(x, y);
}

} // namespace LIBC_NAMESPACE
18 changes: 18 additions & 0 deletions libc/src/math/nvptx/remainderf.cpp
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 LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) {
return __builtin_remainderf(x, y);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/remquo.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, remquo, (double x, double y, int *quo)) {
return internal::remquo(x, y, quo);
return __nv_remquo(x, y, quo);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/remquof.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, remquof, (float x, float y, int *quo)) {
return internal::remquof(x, y, quo);
return __nv_remquof(x, y, quo);
}

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/rint.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU rint 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/rint.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, rint, (double x)) { return __builtin_rint(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/rintf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU rintf 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/rintf.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, rintf, (float x)) { return __builtin_rintf(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/round.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU round 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/round.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, round, (double x)) { return __builtin_round(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/roundf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU roundf 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/roundf.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, roundf, (float x)) { return __builtin_roundf(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/scalbn.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, scalbn, (double x, int y)) {
return internal::scalbn(x, y);
return __nv_scalbn(x, y);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/scalbnf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, scalbnf, (float x, int y)) {
return internal::scalbnf(x, y);
return __nv_scalbnf(x, y);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/sin.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, sin, (double x)) { return internal::sin(x); }
LLVM_LIBC_FUNCTION(double, sin, (double x)) { return __nv_sin(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include "src/math/sincos.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(void, sincos, (double x, double *sinptr, double *cosptr)) {
return internal::sincos(x, sinptr, cosptr);
return __nv_sincos(x, sinptr, cosptr);
}

} // namespace LIBC_NAMESPACE
20 changes: 20 additions & 0 deletions libc/src/math/nvptx/sincosf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===-- Implementation of the sincosf function for GPU --------------------===//
//
// 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/sincosf.h"
#include "src/__support/common.h"

#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(void, sincosf, (float x, float *sinptr, float *cosptr)) {
return __nv_sincosf(x, sinptr, cosptr);
}

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/sinf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, sinf, (float x)) { return internal::sinf(x); }
LLVM_LIBC_FUNCTION(float, sinf, (float x)) { return __nv_sinf(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/sinh.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, sinh, (double x)) { return internal::sinh(x); }
LLVM_LIBC_FUNCTION(double, sinh, (double x)) { return __nv_sinh(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/sinhf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, sinhf, (float x)) { return internal::sinhf(x); }
LLVM_LIBC_FUNCTION(float, sinhf, (float x)) { return __nv_sinhf(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/sqrt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU sqrt 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/sqrt.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, sqrt, (double x)) { return __builtin_sqrt(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/sqrtf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU sqrtf 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/sqrtf.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, sqrtf, (float x)) { return __builtin_sqrtf(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tan.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, tan, (double x)) { return internal::tan(x); }
LLVM_LIBC_FUNCTION(double, tan, (double x)) { return __nv_tan(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tanf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, tanf, (float x)) { return internal::tanf(x); }
LLVM_LIBC_FUNCTION(float, tanf, (float x)) { return __nv_tanf(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tanh.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, tanh, (double x)) { return internal::tanh(x); }
LLVM_LIBC_FUNCTION(double, tanh, (double x)) { return __nv_tanh(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tanhf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, tanhf, (float x)) { return internal::tanhf(x); }
LLVM_LIBC_FUNCTION(float, tanhf, (float x)) { return __nv_tanhf(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tgamma.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, tgamma, (double x)) { return internal::tgamma(x); }
LLVM_LIBC_FUNCTION(double, tgamma, (double x)) { return __nv_tgamma(x); }

} // namespace LIBC_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "src/math/tgammaf.h"
#include "src/__support/common.h"

#include "common.h"
#include "declarations.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, tgammaf, (float x)) { return internal::tgammaf(x); }
LLVM_LIBC_FUNCTION(float, tgammaf, (float x)) { return __nv_tgammaf(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/trunc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU trunc 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/trunc.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(double, trunc, (double x)) { return __builtin_trunc(x); }

} // namespace LIBC_NAMESPACE
16 changes: 16 additions & 0 deletions libc/src/math/nvptx/truncf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- Implementation of the GPU truncf 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/truncf.h"
#include "src/__support/common.h"

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(float, truncf, (float x)) { return __builtin_truncf(x); }

} // namespace LIBC_NAMESPACE