[llvm-branch-commits] [libc] [AArch64] - cannot build from release/18.x (PR #101358)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 31 09:20:37 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: catull (catull)

<details>
<summary>Changes</summary>

Ran into the same problem reported in the mailing list at https://www.mail-archive.com/llvm-bugs@<!-- -->lists.llvm.org/msg73342.html.

The PR fixes the build.

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


1 Files Affected:

- (modified) libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h (+6-4) 


``````````diff
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index ea1fd68a5fcdf..efd956f14a8a2 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -161,8 +161,8 @@ LIBC_INLINE int set_except(int excepts) {
 LIBC_INLINE int raise_except(int excepts) {
   float zero = 0.0f;
   float one = 1.0f;
-  float large_value = FPBits<float>::max_normal();
-  float small_value = FPBits<float>::min_normal();
+  float large_value = FPBits<float>::max_normal().get_val();
+  float small_value = FPBits<float>::min_normal().get_val();
   auto divfunc = [](float a, float b) {
     __asm__ __volatile__("ldr  s0, %0\n\t"
                          "ldr  s1, %1\n\t"
@@ -277,8 +277,10 @@ LIBC_INLINE int set_env(const fenv_t *envp) {
     return 0;
   }
   const FEnv::FPState *state = reinterpret_cast<const FEnv::FPState *>(envp);
-  FEnv::set_control_word(state->ControlWord);
-  FEnv::set_status_word(state->StatusWord);
+  uint32_t control_word = static_cast<uint32_t>(state->ControlWord);
+  uint32_t status_word = static_cast<uint32_t>(state->StatusWord);
+  FEnv::set_control_word(control_word);
+  FEnv::set_status_word(status_word);
   return 0;
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/101358


More information about the llvm-branch-commits mailing list