Skip to content

Commit a5fcc6b

Browse files
committed
Address review feedback
1 parent 8536340 commit a5fcc6b

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ set(TARGET_LIBM_ENTRYPOINTS
414414
libc.src.math.ilogb
415415
libc.src.math.ilogbf
416416
libc.src.math.ilogbl
417+
libc.src.math.isnan
418+
libc.src.math.isnanf
419+
libc.src.math.isnanl
417420
libc.src.math.llogb
418421
libc.src.math.llogbf
419422
libc.src.math.llogbl

libc/config/linux/riscv/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ set(TARGET_LIBM_ENTRYPOINTS
422422
libc.src.math.ilogb
423423
libc.src.math.ilogbf
424424
libc.src.math.ilogbl
425+
libc.src.math.isnan
426+
libc.src.math.isnanf
427+
libc.src.math.isnanl
425428
libc.src.math.ldexp
426429
libc.src.math.ldexpf
427430
libc.src.math.ldexpl

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ set(TARGET_LIBM_ENTRYPOINTS
440440
libc.src.math.ilogb
441441
libc.src.math.ilogbf
442442
libc.src.math.ilogbl
443+
libc.src.math.isnan
444+
libc.src.math.isnanf
445+
libc.src.math.isnanl
443446
libc.src.math.ldexp
444447
libc.src.math.ldexpf
445448
libc.src.math.ldexpl
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//===-- Definition of function macros from math.h -------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_MACROS_MATH_FUNCTION_MACROS_H
10+
#define LLVM_LIBC_MACROS_MATH_FUNCTION_MACROS_H
11+
12+
#define isfinite(x) __builtin_isfinite(x)
13+
#define isinf(x) __builtin_isinf(x)
14+
#define isnan(x) __builtin_isnan(x)
15+
16+
#endif // LLVM_LIBC_MACROS_MATH_FUNCTION_MACROS_H

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,4 @@
5151
#define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
5252
#endif
5353

54-
// TODO: Move generic functional math macros to a separate header file.
55-
#define isfinite(x) __builtin_isfinite(x)
56-
#define isinf(x) __builtin_isinf(x)
57-
5854
#endif // LLVM_LIBC_MACROS_MATH_MACROS_H

libc/include/math.h.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
%%public_api()
1919

20-
#define isnan(x) __builtin_isnan(x)
20+
21+
#include "llvm-libc-macros/math-function-macros.h"
2122

2223
#endif // LLVM_LIBC_MATH_H

0 commit comments

Comments
 (0)