[libc-commits] [libc] [libc][math][c23] Add asinhf16() function (PR #131351)
Tejas Vipin via libc-commits
libc-commits at lists.llvm.org
Tue Mar 18 00:26:26 PDT 2025
meltq wrote:
@overmighty https://github.com/llvm/llvm-project/pull/131351/commits/dc07f5287aa7286f9ec3d57dd3dd63221a2bdbc3 that I just pushed implements the change you suggested for `ASINHF16_EXCEPTS` but clang-format does seem to flag it. This is the diff I get after running clang-format locally
```
diff --git a/libc/src/math/generic/asinhf16.cpp b/libc/src/math/generic/asinhf16.cpp
index 7110d1f5cc96..52e46bfc6267 100644
--- a/libc/src/math/generic/asinhf16.cpp
+++ b/libc/src/math/generic/asinhf16.cpp
@@ -22,26 +22,25 @@ namespace LIBC_NAMESPACE_DECL {
#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
static constexpr size_t N_EXCEPTS = 8;
-static constexpr fputil::ExceptValues<float16, N_EXCEPTS> ASINHF16_EXCEPTS{{
- // (input, RZ output, RU offset, RD offset, RN offset)
-
- // x = 0x1.da4p-2, asinhf16(x) = 0x1.ca8p-2 (RZ)
- {0x3769, 0x372a, 1, 0, 1},
- // x = 0x1.d6cp-1, asinhf16(x) = 0x1.a58p-1 (RZ)
- {0x3b5b, 0x3a96, 1, 0, 0},
- // x = 0x1.c7cp+3, asinhf16(x) = 0x1.accp+1 (RZ)
- {0x4b1f, 0x42b3, 1, 0, 0},
- // x = 0x1.26cp+4, asinhf16(x) = 0x1.cd8p+1 (RZ)
- {0x4c9b, 0x4336, 1, 0, 1},
- // x = -0x1.da4p-2, asinhf16(x) = -0x1.ca8p-2 (RZ)
- {0xb769, 0xb72a, 0, 1, 1},
- // x = -0x1.d6cp-1, asinhf16(x) = -0x1.a58p-1 (RZ)
- {0xbb5b, 0xba96, 0, 1, 0},
- // x = -0x1.c7cp+3, asinhf16(x) = -0x1.accp+1 (RZ)
- {0xcb1f, 0xc2b3, 0, 1, 0},
- // x = -0x1.26cp+4, asinhf16(x) = -0x1.cd8p+1 (RZ)
- {0xcc9b, 0xc336, 0, 1, 1}
-}};
+static constexpr fputil::ExceptValues<float16, N_EXCEPTS> ASINHF16_EXCEPTS{
+ {// (input, RZ output, RU offset, RD offset, RN offset)
+
+ // x = 0x1.da4p-2, asinhf16(x) = 0x1.ca8p-2 (RZ)
+ {0x3769, 0x372a, 1, 0, 1},
+ // x = 0x1.d6cp-1, asinhf16(x) = 0x1.a58p-1 (RZ)
+ {0x3b5b, 0x3a96, 1, 0, 0},
+ // x = 0x1.c7cp+3, asinhf16(x) = 0x1.accp+1 (RZ)
+ {0x4b1f, 0x42b3, 1, 0, 0},
+ // x = 0x1.26cp+4, asinhf16(x) = 0x1.cd8p+1 (RZ)
+ {0x4c9b, 0x4336, 1, 0, 1},
+ // x = -0x1.da4p-2, asinhf16(x) = -0x1.ca8p-2 (RZ)
+ {0xb769, 0xb72a, 0, 1, 1},
+ // x = -0x1.d6cp-1, asinhf16(x) = -0x1.a58p-1 (RZ)
+ {0xbb5b, 0xba96, 0, 1, 0},
+ // x = -0x1.c7cp+3, asinhf16(x) = -0x1.accp+1 (RZ)
+ {0xcb1f, 0xc2b3, 0, 1, 0},
+ // x = -0x1.26cp+4, asinhf16(x) = -0x1.cd8p+1 (RZ)
+ {0xcc9b, 0xc336, 0, 1, 1}}};
#endif // !LIBC_MATH_HAS_SKIP_ACCURATE_PASS
```
https://github.com/llvm/llvm-project/pull/131351
More information about the libc-commits
mailing list