Skip to content

[libc][math] Fix missing LIBC_INLINE on exp_range_reduction() function #103305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

overmighty
Copy link
Member

@overmighty overmighty requested review from jhuber6 and lntue August 13, 2024 16:13
@llvmbot llvmbot added the libc label Aug 13, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 13, 2024

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

Changes

See Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/73/builds/3669.


Full diff: https://github.com/llvm/llvm-project/pull/103305.diff

2 Files Affected:

  • (modified) libc/src/math/generic/CMakeLists.txt (+1)
  • (modified) libc/src/math/generic/expxf16.h (+2-1)
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index faa910139fa355..745bd65e1d75b5 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -1367,6 +1367,7 @@ add_entrypoint_object(
     libc.src.__support.FPUtil.fp_bits
     libc.src.__support.FPUtil.polyeval
     libc.src.__support.FPUtil.rounding_mode
+    libc.src.__support.macros.attributes
     libc.src.__support.macros.optimization
   COMPILE_OPTIONS
     -O3
diff --git a/libc/src/math/generic/expxf16.h b/libc/src/math/generic/expxf16.h
index 53815e0e275533..a0db6cee438e92 100644
--- a/libc/src/math/generic/expxf16.h
+++ b/libc/src/math/generic/expxf16.h
@@ -13,6 +13,7 @@
 #include "src/__support/FPUtil/PolyEval.h"
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/FPUtil/nearest_integer.h"
+#include "src/__support/macros/attributes.h"
 #include "src/__support/macros/config.h"
 #include <stdint.h>
 
@@ -45,7 +46,7 @@ struct ExpRangeReduction {
   float exp_lo;
 };
 
-ExpRangeReduction exp_range_reduction(float16 x) {
+LIBC_INLINE ExpRangeReduction exp_range_reduction(float16 x) {
   // For -18 < x < 12, to compute exp(x), we perform the following range
   // reduction: find hi, mid, lo, such that:
   //   x = hi + mid + lo, in which

@overmighty overmighty merged commit b4c4c79 into llvm:main Aug 13, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants