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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(double, remquo, (double x, double y, int *quo)) {
return __builtin_remquo(x, y, quo);
}

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(float, remquof, (float x, float y, int *quo)) {
return __builtin_remquof(x, y, quo);
}

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(double, scalbn, (double x, int y)) {
return __builtin_scalbn(x, y);
}

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(float, scalbnf, (float x, int y)) {
return __builtin_scalbnf(x, y);
}

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(double, sinh, (double x)) { return __builtin_sinh(x); }

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(float, sinhf, (float x)) { return __builtin_sinhf(x); }

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(double, tan, (double x)) { return __builtin_tan(x); }

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(float, tanf, (float x)) { return __builtin_tanf(x); }

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(double, tanh, (double x)) { return __builtin_tanh(x); }

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

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(float, tanhf, (float x)) { return __builtin_tanhf(x); }

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

} // namespace __llvm_libc
16 changes: 16 additions & 0 deletions libc/src/math/gpu/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 __llvm_libc {

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

} // namespace __llvm_libc
121 changes: 121 additions & 0 deletions libc/src/math/gpu/vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,28 @@ add_entrypoint_object(
-O2
)

add_entrypoint_object(
nextafter
SRCS
nextafter.cpp
HDRS
../../nextafter.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
nextafterf
SRCS
nextafterf.cpp
HDRS
../../nextafterf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
pow
SRCS
Expand Down Expand Up @@ -347,3 +369,102 @@ add_entrypoint_object(
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
sinf
SRCS
sinf.cpp
HDRS
../../sinf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
sincos
SRCS
sincos.cpp
HDRS
../../sincos.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
sincosf
SRCS
sincosf.cpp
HDRS
../../sincosf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
sinh
SRCS
sinh.cpp
HDRS
../../sinh.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
sinhf
SRCS
sinhf.cpp
HDRS
../../sinhf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
tan
SRCS
tan.cpp
HDRS
../../tan.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
tanf
SRCS
tanf.cpp
HDRS
../../tanf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
tanh
SRCS
tanh.cpp
HDRS
../../tanh.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)

add_entrypoint_object(
tanhf
SRCS
tanhf.cpp
HDRS
../../tanhf.h
COMPILE_OPTIONS
${bitcode_link_flags}
-O2
)
19 changes: 19 additions & 0 deletions libc/src/math/gpu/vendor/amdgpu/amdgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,28 @@ LIBC_INLINE long long llrint(double x) { return __builtin_rint(x); }
LIBC_INLINE long long llrintf(float x) { return __builtin_rintf(x); }
LIBC_INLINE long long llround(double x) { return __builtin_round(x); }
LIBC_INLINE long long llroundf(float x) { return __builtin_roundf(x); }
LIBC_INLINE double nextafter(double x, double y) {
return __ocml_nextafter_f64(x, y);
}
LIBC_INLINE float nextafterf(float x, float y) {
return __ocml_nextafter_f32(x, y);
}
LIBC_INLINE double pow(double x, double y) { return __ocml_pow_f64(x, y); }
LIBC_INLINE float powf(float x, float y) { return __ocml_pow_f32(x, y); }
LIBC_INLINE double sin(double x) { return __ocml_sin_f64(x); }
LIBC_INLINE float sinf(float x) { return __ocml_sin_f32(x); }
LIBC_INLINE void sincos(double x, double *sinptr, double *cosptr) {
*sinptr = __ocml_sincos_f64(x, cosptr);
}
LIBC_INLINE void sincosf(float x, float *sinptr, float *cosptr) {
*sinptr = __ocml_sincos_f32(x, cosptr);
}
LIBC_INLINE double sinh(double x) { return __ocml_sinh_f64(x); }
LIBC_INLINE float sinhf(float x) { return __ocml_sinh_f32(x); }
LIBC_INLINE double tan(double x) { return __ocml_tan_f64(x); }
LIBC_INLINE float tanf(float x) { return __ocml_tan_f32(x); }
LIBC_INLINE double tanh(double x) { return __ocml_tanh_f64(x); }
LIBC_INLINE float tanhf(float x) { return __ocml_tanh_f32(x); }

} // namespace internal
} // namespace __llvm_libc
Expand Down
11 changes: 11 additions & 0 deletions libc/src/math/gpu/vendor/amdgpu/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,24 @@ int __ocml_ilogb_f64(double);
int __ocml_ilogb_f32(float);
float __ocml_ldexp_f32(float, int);
double __ocml_ldexp_f64(double, int);
float __ocml_nextafter_f32(float, float);
double __ocml_nextafter_f64(double, double);
float __ocml_pow_f32(float, float);
double __ocml_pow_f64(double, double);
double __ocml_rint_f64(double);
float __ocml_rint_f32(float);
double __ocml_round_f64(double);
float __ocml_round_f32(float);
float __ocml_sin_f32(float);
double __ocml_sin_f64(double);
float __ocml_sincos_f32(float, float *);
double __ocml_sincos_f64(double, double *);
float __ocml_sinh_f32(float);
double __ocml_sinh_f64(double);
float __ocml_tan_f32(float);
double __ocml_tan_f64(double);
float __ocml_tanh_f32(float);
double __ocml_tanh_f64(double);
}

} // namespace __llvm_libc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
//===-- Implementation of the GPU roundl function -------------------------===//
//===-- Implementation of the nextafter 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/roundl.h"
#include "src/__support/FPUtil/PlatformDefs.h"
#include "src/math/nextafter.h"
#include "src/__support/common.h"

namespace __llvm_libc {
#include "common.h"

#ifndef LONG_DOUBLE_IS_DOUBLE
#error "GPU targets do not support long doubles"
#endif
namespace __llvm_libc {

LLVM_LIBC_FUNCTION(long double, roundl, (long double x)) {
return __builtin_round(x);
LLVM_LIBC_FUNCTION(double, nextafter, (double x, double y)) {
return internal::nextafter(x, y);
}

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

#include "common.h"

namespace __llvm_libc {

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

} // namespace __llvm_libc
11 changes: 11 additions & 0 deletions libc/src/math/gpu/vendor/nvptx/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,20 @@ long long __nv_llrint(double);
long long __nv_llrintf(float);
long long __nv_llround(double);
long long __nv_llroundf(float);
double __nv_nextafter(double, double);
float __nv_nextafterf(float, float);
double __nv_pow(double, double);
float __nv_powf(float, float);
double __nv_sin(double);
float __nv_sinf(float);
void __nv_sincos(double, double *, double *);
void __nv_sincosf(float, float *, float *);
double __nv_sinh(double);
float __nv_sinhf(float);
double __nv_tan(double);
float __nv_tanf(float);
double __nv_tanh(double);
float __nv_tanhf(float);
}

} // namespace __llvm_libc
Expand Down
17 changes: 17 additions & 0 deletions libc/src/math/gpu/vendor/nvptx/nvptx.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,26 @@ LIBC_INLINE long long llrint(double x) { return __nv_llrint(x); }
LIBC_INLINE long long llrintf(float x) { return __nv_llrintf(x); }
LIBC_INLINE long long llround(double x) { return __nv_llround(x); }
LIBC_INLINE long long llroundf(float x) { return __nv_llroundf(x); }
LIBC_INLINE double nextafter(double x, double y) {
return __nv_nextafter(x, y);
}
LIBC_INLINE float nextafterf(float x, float y) { return __nv_nextafterf(x, y); }
LIBC_INLINE double pow(double x, double y) { return __nv_pow(x, y); }
LIBC_INLINE float powf(float x, float y) { return __nv_powf(x, y); }
LIBC_INLINE double sin(double x) { return __nv_sin(x); }
LIBC_INLINE float sinf(float x) { return __nv_sinf(x); }
LIBC_INLINE void sincos(double x, double *sinptr, double *cosptr) {
return __nv_sincos(x, sinptr, cosptr);
}
LIBC_INLINE void sincosf(float x, float *sinptr, float *cosptr) {
return __nv_sincosf(x, sinptr, cosptr);
}
LIBC_INLINE double sinh(double x) { return __nv_sinh(x); }
LIBC_INLINE float sinhf(float x) { return __nv_sinhf(x); }
LIBC_INLINE double tan(double x) { return __nv_tan(x); }
LIBC_INLINE float tanf(float x) { return __nv_tanf(x); }
LIBC_INLINE double tanh(double x) { return __nv_tanh(x); }
LIBC_INLINE float tanhf(float x) { return __nv_tanhf(x); }

} // namespace internal
} // namespace __llvm_libc
Expand Down
20 changes: 20 additions & 0 deletions libc/src/math/gpu/vendor/sincos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===-- Implementation of the sincos 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/sincos.h"
#include "src/__support/common.h"

#include "common.h"

namespace __llvm_libc {

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

} // namespace __llvm_libc
20 changes: 20 additions & 0 deletions libc/src/math/gpu/vendor/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 "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

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

#include "common.h"

namespace __llvm_libc {

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

} // namespace __llvm_libc
18 changes: 18 additions & 0 deletions libc/src/math/sinh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===-- Implementation header for sinh --------------------------*- 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_SRC_MATH_SINH_H
#define LLVM_LIBC_SRC_MATH_SINH_H

namespace __llvm_libc {

double sinh(double x);

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_MATH_SINH_H
18 changes: 18 additions & 0 deletions libc/src/math/tanh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===-- Implementation header for tanh --------------------------*- 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_SRC_MATH_TANH_H
#define LLVM_LIBC_SRC_MATH_TANH_H

namespace __llvm_libc {

double tanh(double x);

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_MATH_TANH_H