Skip to content

Commit 30f3a33

Browse files
committed
[libc][math] fix-exp
1 parent 1f97c94 commit 30f3a33

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

libc/src/__support/FPUtil/PolyEval.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ namespace LIBC_NAMESPACE_DECL {
2525
namespace fputil {
2626

2727
template <typename T>
28-
LIBC_INLINE cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
28+
LIBC_INLINE static constexpr cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
2929
polyeval(const T &, const T &a0) {
3030
return a0;
3131
}
3232

3333
template <typename T>
34-
LIBC_INLINE cpp::enable_if_t<(sizeof(T) <= sizeof(void *)), T> polyeval(T,
35-
T a0) {
34+
LIBC_INLINE static constexpr cpp::enable_if_t<(sizeof(T) <= sizeof(void *)), T>
35+
polyeval(T, T a0) {
3636
return a0;
3737
}
3838

3939
template <typename T, typename... Ts>
40-
LIBC_INLINE cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
40+
LIBC_INLINE static constexpr cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
4141
polyeval(const T &x, const T &a0, const Ts &...a) {
4242
return multiply_add(x, polyeval(x, a...), a0);
4343
}

libc/src/__support/FPUtil/multiply_add.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ namespace fputil {
2323
// which uses FMA instructions to speed up if available.
2424

2525
template <typename T>
26-
LIBC_INLINE cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
26+
LIBC_INLINE static constexpr cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
2727
multiply_add(const T &x, const T &y, const T &z) {
2828
return x * y + z;
2929
}
3030

3131
template <typename T>
32-
LIBC_INLINE cpp::enable_if_t<(sizeof(T) <= sizeof(void *)), T>
32+
LIBC_INLINE static constexpr cpp::enable_if_t<(sizeof(T) <= sizeof(void *)), T>
3333
multiply_add(T x, T y, T z) {
3434
return x * y + z;
3535
}
@@ -47,7 +47,7 @@ namespace LIBC_NAMESPACE_DECL {
4747
namespace fputil {
4848

4949
#ifdef LIBC_TARGET_CPU_HAS_FMA_FLOAT
50-
LIBC_INLINE float multiply_add(float x, float y, float z) {
50+
LIBC_INLINE static constexpr float multiply_add(float x, float y, float z) {
5151
#if __has_builtin(__builtin_elementwise_fma)
5252
return __builtin_elementwise_fma(x, y, z);
5353
#else
@@ -57,7 +57,7 @@ LIBC_INLINE float multiply_add(float x, float y, float z) {
5757
#endif // LIBC_TARGET_CPU_HAS_FMA_FLOAT
5858

5959
#ifdef LIBC_TARGET_CPU_HAS_FMA_DOUBLE
60-
LIBC_INLINE double multiply_add(double x, double y, double z) {
60+
LIBC_INLINE static constexpr double multiply_add(double x, double y, double z) {
6161
#if __has_builtin(__builtin_elementwise_fma)
6262
return __builtin_elementwise_fma(x, y, z);
6363
#else

0 commit comments

Comments
 (0)