diff options
Diffstat (limited to 'libc/src/math/nvptx')
-rw-r--r-- | libc/src/math/nvptx/declarations.h | 6 | ||||
-rw-r--r-- | libc/src/math/nvptx/fmax.cpp | 6 | ||||
-rw-r--r-- | libc/src/math/nvptx/fmaxf.cpp | 4 | ||||
-rw-r--r-- | libc/src/math/nvptx/fmin.cpp | 6 | ||||
-rw-r--r-- | libc/src/math/nvptx/fminf.cpp | 6 | ||||
-rw-r--r-- | libc/src/math/nvptx/nvptx.h | 6 |
6 files changed, 6 insertions, 28 deletions
diff --git a/libc/src/math/nvptx/declarations.h b/libc/src/math/nvptx/declarations.h index 9cb2be6..d41b16c 100644 --- a/libc/src/math/nvptx/declarations.h +++ b/libc/src/math/nvptx/declarations.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIBC_SRC_MATH_GPU_NVPTX_DECLARATIONS_H -#define LLVM_LIBC_SRC_MATH_GPU_NVPTX_DECLARATIONS_H +#ifndef LLVM_LIBC_SRC_MATH_NVPTX_DECLARATIONS_H +#define LLVM_LIBC_SRC_MATH_NVPTX_DECLARATIONS_H namespace LIBC_NAMESPACE { @@ -86,4 +86,4 @@ float __nv_tgammaf(float); } // namespace LIBC_NAMESPACE -#endif // LLVM_LIBC_SRC_MATH_GPU_NVPTX_DECLARATIONS_H +#endif // LLVM_LIBC_SRC_MATH_NVPTX_DECLARATIONS_H diff --git a/libc/src/math/nvptx/fmax.cpp b/libc/src/math/nvptx/fmax.cpp index 09624cc..3ba65d7 100644 --- a/libc/src/math/nvptx/fmax.cpp +++ b/libc/src/math/nvptx/fmax.cpp @@ -8,17 +8,11 @@ #include "src/math/fmax.h" -#include "src/__support/CPP/bit.h" #include "src/__support/common.h" -#include "src/__support/macros/optimization.h" namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(double, fmax, (double x, double y)) { - // FIXME: The builtin function does not correctly handle the +/-0.0 case. - if (LIBC_UNLIKELY(x == y)) - return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) & - cpp::bit_cast<uint64_t>(y)); return __builtin_fmax(x, y); } diff --git a/libc/src/math/nvptx/fmaxf.cpp b/libc/src/math/nvptx/fmaxf.cpp index f6ed466..e977082 100644 --- a/libc/src/math/nvptx/fmaxf.cpp +++ b/libc/src/math/nvptx/fmaxf.cpp @@ -15,10 +15,6 @@ namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(float, fmaxf, (float x, float y)) { - // FIXME: The builtin function does not correctly handle the +/-0.0 case. - if (LIBC_UNLIKELY(x == y)) - return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) & - cpp::bit_cast<uint32_t>(y)); return __builtin_fmaxf(x, y); } diff --git a/libc/src/math/nvptx/fmin.cpp b/libc/src/math/nvptx/fmin.cpp index 8977ff7..0d6f352 100644 --- a/libc/src/math/nvptx/fmin.cpp +++ b/libc/src/math/nvptx/fmin.cpp @@ -8,17 +8,11 @@ #include "src/math/fmin.h" -#include "src/__support/CPP/bit.h" #include "src/__support/common.h" -#include "src/__support/macros/optimization.h" namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(double, fmin, (double x, double y)) { - // FIXME: The builtin function does not correctly handle the +/-0.0 case. - if (LIBC_UNLIKELY(x == y)) - return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) | - cpp::bit_cast<uint64_t>(y)); return __builtin_fmin(x, y); } diff --git a/libc/src/math/nvptx/fminf.cpp b/libc/src/math/nvptx/fminf.cpp index 3be5525..42744abf 100644 --- a/libc/src/math/nvptx/fminf.cpp +++ b/libc/src/math/nvptx/fminf.cpp @@ -8,17 +8,11 @@ #include "src/math/fminf.h" -#include "src/__support/CPP/bit.h" #include "src/__support/common.h" -#include "src/__support/macros/optimization.h" namespace LIBC_NAMESPACE { LLVM_LIBC_FUNCTION(float, fminf, (float x, float y)) { - // FIXME: The builtin function does not correctly handle the +/-0.0 case. - if (LIBC_UNLIKELY(x == y)) - return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) | - cpp::bit_cast<uint32_t>(y)); return __builtin_fminf(x, y); } diff --git a/libc/src/math/nvptx/nvptx.h b/libc/src/math/nvptx/nvptx.h index 110d570..5f9b32f 100644 --- a/libc/src/math/nvptx/nvptx.h +++ b/libc/src/math/nvptx/nvptx.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIBC_SRC_MATH_GPU_NVPTX_H -#define LLVM_LIBC_SRC_MATH_GPU_NVPTX_H +#ifndef LLVM_LIBC_SRC_MATH_NVPTX_NVPTX_H +#define LLVM_LIBC_SRC_MATH_NVPTX_NVPTX_H #include "declarations.h" @@ -99,4 +99,4 @@ LIBC_INLINE float tgammaf(float x) { return __nv_tgammaf(x); } } // namespace internal } // namespace LIBC_NAMESPACE -#endif // LLVM_LIBC_SRC_MATH_GPU_NVPTX_H +#endif // LLVM_LIBC_SRC_MATH_NVPTX_NVPTX_H |