Skip to content

Commit cde1efd

Browse files
committed
Update bazel, progress docs, address review comments
1 parent 6a9f4c4 commit cde1efd

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

libc/docs/math/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ Basic Operations
230230
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
231231
| nextafterl | |check| | |check| | | |check| | |check| | | | |check| | | | | |
232232
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
233-
| nexttoward | | | | | | | | | | | | |
233+
| nexttoward | |check| | |check| | | |check| | |check| | | | |check| | | | | |
234234
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
235-
| nexttowardf | | | | | | | | | | | | |
235+
| nexttowardf | |check| | |check| | | |check| | |check| | | | |check| | | | | |
236236
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
237-
| nexttowardl | | | | | | | | | | | | |
237+
| nexttowardl | |check| | |check| | | |check| | |check| | | | |check| | | | | |
238238
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
239239
| remainder | |check| | |check| | | |check| | |check| | | | |check| | | | | |
240240
+--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+

libc/src/__support/FPUtil/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ add_header_library(
9494
HDRS
9595
ManipulationFunctions.h
9696
DEPENDS
97+
.fenv_impl
9798
.fp_bits
9899
.nearest_integer_operations
99100
.normal_float

libc/src/__support/FPUtil/ManipulationFunctions.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
#include "src/__support/CPP/bit.h"
1919
#include "src/__support/CPP/type_traits.h"
20+
#include "src/__support/FPUtil/FEnvImpl.h"
2021
#include "src/__support/macros/attributes.h"
2122
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
2223

23-
#include <fenv.h>
2424
#include <limits.h>
2525
#include <math.h>
2626

@@ -180,8 +180,9 @@ LIBC_INLINE T nextafter(T from, T to) {
180180
return cpp::bit_cast<T>(int_val);
181181
}
182182

183-
template <typename T, cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>
184-
LIBC_INLINE T nexttoward(T from, long double to) {
183+
template <typename T>
184+
LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, T>
185+
nexttoward(T from, long double to) {
185186
FPBits<T> from_bits(from);
186187
if (from_bits.is_nan())
187188
return from;

libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#endif
1717

1818
#include "src/__support/CPP/bit.h"
19+
#include "src/__support/FPUtil/FEnvImpl.h"
1920
#include "src/__support/FPUtil/FPBits.h"
2021

2122
#include <stdint.h>

libc/src/math/generic/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ add_entrypoint_object(
14831483
DEPENDS
14841484
libc.src.__support.FPUtil.manipulation_functions
14851485
COMPILE_OPTIONS
1486-
-O2
1486+
-O3
14871487
)
14881488

14891489
add_entrypoint_object(
@@ -1495,7 +1495,7 @@ add_entrypoint_object(
14951495
DEPENDS
14961496
libc.src.__support.FPUtil.manipulation_functions
14971497
COMPILE_OPTIONS
1498-
-O2
1498+
-O3
14991499
)
15001500

15011501
add_entrypoint_object(
@@ -1507,7 +1507,7 @@ add_entrypoint_object(
15071507
DEPENDS
15081508
libc.src.__support.FPUtil.manipulation_functions
15091509
COMPILE_OPTIONS
1510-
-O2
1510+
-O3
15111511
)
15121512

15131513
add_entrypoint_object(

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,12 @@ libc_math_function(name = "nextafterf")
18721872

18731873
libc_math_function(name = "nextafterl")
18741874

1875+
libc_math_function(name = "nexttoward")
1876+
1877+
libc_math_function(name = "nexttowardf")
1878+
1879+
libc_math_function(name = "nexttowardl")
1880+
18751881
libc_math_function(name = "scalbn")
18761882

18771883
libc_math_function(name = "scalbnf")

0 commit comments

Comments
 (0)