Skip to content

Commit 5c40e56

Browse files
authored
[libc] Make GPU libm use generic implementations (#98014)
Summary: This patch moves a lot of the old vendor implementations to the new generic math functions. Previously a lot of these were done through the vendor functions, but the long term goal is to completely phase these out. In order to make the tests pass I had to disable exceptions so they only perform functional tests.
1 parent f4f5e25 commit 5c40e56

File tree

6 files changed

+51
-1201
lines changed

6 files changed

+51
-1201
lines changed

libc/include/llvm-libc-macros/math-macros.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@
4141
#define FP_LLOGBNAN LONG_MAX
4242
#endif
4343

44-
#ifdef __FAST_MATH__
44+
#if defined(__NVPTX__) || defined(__AMDGPU__) || defined(__FAST_MATH__)
4545
#define math_errhandling 0
4646
#elif defined(__NO_MATH_ERRNO__)
4747
#define math_errhandling (MATH_ERREXCEPT)
48-
#elif defined(__NVPTX__) || defined(__AMDGPU__)
49-
#define math_errhandling (MATH_ERRNO)
5048
#else
5149
#define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
5250
#endif

0 commit comments

Comments
 (0)