Skip to content

Commit 09b7930

Browse files
committed
small fix
1 parent 1d5f809 commit 09b7930

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libc/src/math/generic/sinf16.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919

2020
namespace LIBC_NAMESPACE_DECL {
2121

22-
constexpr size_t N_EXCEPTS = 2;
22+
constexpr size_t N_EXCEPTS = 3;
2323

2424
constexpr fputil::ExceptValues<float16, N_EXCEPTS> SINF16_EXCEPTS{{
2525
// (input, RZ output, RU offset, RD offset, RN offset)
2626
{0x585c, 0x3ba3, 1, 0, 1},
2727
{0x5cb0, 0xbbff, 0, 1, 0},
28+
{0x51f5, 0xb80f, 0, 1, 0},
2829
}};
2930

3031
LLVM_LIBC_FUNCTION(float16, sinf16, (float16 x)) {
@@ -52,7 +53,7 @@ LLVM_LIBC_FUNCTION(float16, sinf16, (float16 x)) {
5253
// sin(y * pi/32) * cos(k * pi/32)
5354

5455
// Handle exceptional values
55-
if (LIBC_UNLIKELY(x_abs == 0x585C || x_abs == 0x5cb0)) {
56+
if (LIBC_UNLIKELY(x_abs == 0x585C || x_abs == 0x5cb0 || x_abs == 0x51f5)) {
5657
bool x_sign = x_u >> 15;
5758
if (auto r = SINF16_EXCEPTS.lookup_odd(x_abs, x_sign);
5859
LIBC_UNLIKELY(r.has_value()))

0 commit comments

Comments
 (0)