Skip to content

Commit a22b106

Browse files
committed
fix gcc problems
1 parent cff531d commit a22b106

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libc/src/__support/FPUtil/multiply_add.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ multiply_add(const T &x, const T &y, const T &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
}

libc/src/__support/FPUtil/nearest_integer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace fputil {
4040
// Notice that for AARCH64 and x86-64 with SSE4.2 support, we will use their
4141
// corresponding rounding instruction instead. And in those cases, the results
4242
// are rounded to the nearest integer, tie-to-even.
43-
LIBC_INLINE float nearest_integer(float x) {
43+
LIBC_INLINE static constexpr float nearest_integer(float x) {
4444
if (x < 0x1p24f && x > -0x1p24f) {
4545
float r = x < 0 ? (x - 0x1.0p23f) + 0x1.0p23f : (x + 0x1.0p23f) - 0x1.0p23f;
4646
float diff = x - r;
@@ -56,7 +56,7 @@ LIBC_INLINE float nearest_integer(float x) {
5656
return x;
5757
}
5858

59-
LIBC_INLINE double nearest_integer(double x) {
59+
LIBC_INLINE static constexpr double nearest_integer(double x) {
6060
if (x < 0x1p53 && x > -0x1p53) {
6161
double r = x < 0 ? (x - 0x1.0p52) + 0x1.0p52 : (x + 0x1.0p52) - 0x1.0p52;
6262
double diff = x - r;

libc/src/__support/math/expf16_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct ExpRangeReduction {
4747
float exp_lo;
4848
};
4949

50-
static constexpr ExpRangeReduction exp_range_reduction(float16 x) {
50+
[[maybe_unused]] static ExpRangeReduction exp_range_reduction(float16 x) {
5151
// For -18 < x < 12, to compute exp(x), we perform the following range
5252
// reduction: find hi, mid, lo, such that:
5353
// x = hi + mid + lo, in which

0 commit comments

Comments
 (0)